From 63699e9484108280b4b2f0c166771096bed06288 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Sat, 14 Mar 2026 22:01:20 +0100 Subject: [PATCH] chore: commit dist/ and remove prepare script Pre-built output is now committed to the repository so that Quartz can skip the build step during plugin installation. The prepare script is removed to prevent redundant builds when installing from npm/git. --- .gitignore | 1 - dist/index.js | 166 ++++++++++++++++++++++++++++++++++++++++++++++ dist/index.js.map | 1 + package-lock.json | 43 ++++++------ package.json | 1 - 5 files changed, 187 insertions(+), 25 deletions(-) create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.gitignore b/.gitignore index 657842b..ef88793 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules/ .pnp.js # Build output -dist/ build/ *.tsbuildinfo diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..ad3311d --- /dev/null +++ b/dist/index.js @@ -0,0 +1,166 @@ +import { visit } from 'unist-util-visit'; +import { findAndReplace } from 'mdast-util-find-and-replace'; + +// src/transformer.ts +var defaultOptions = { + orComponent: true, + TODOComponent: true, + DONEComponent: true, + videoComponent: true, + audioComponent: true, + pdfComponent: true, + blockquoteComponent: true, + tableComponent: true, + attributeComponent: true +}; +var orRegex = new RegExp(/{{or:(.*?)}}/, "g"); +var TODORegex = new RegExp(/{{.*?\bTODO\b.*?}}/, "g"); +var DONERegex = new RegExp(/{{.*?\bDONE\b.*?}}/, "g"); +var blockquoteRegex = new RegExp(/(\[\[>\]\])\s*(.*)/, "g"); +var roamHighlightRegex = new RegExp(/\^\^(.+)\^\^/, "g"); +var roamItalicRegex = new RegExp(/__(.+)__/, "g"); +function isSpecialEmbed(node) { + if (node.children.length !== 2) return false; + const [textNode, linkNode] = node.children; + return !!(textNode && textNode.type === "text" && textNode.value.startsWith("{{[[") && linkNode && linkNode.type === "link" && linkNode.children && linkNode.children[0] && linkNode.children[0].type === "text" && linkNode.children[0].value.endsWith("}}")); +} +function transformSpecialEmbed(node, opts) { + const [textNode, linkNode] = node.children; + const embedType = textNode.value.match(/\{\{\[\[(.*?)\]\]:/)?.[1]?.toLowerCase(); + const url = linkNode.url.slice(0, -2); + switch (embedType) { + case "audio": + return opts.audioComponent ? { + type: "html", + value: `` + } : null; + case "video": { + if (!opts.videoComponent) return null; + const youtubeMatch = url.match( + /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/ + ); + if (youtubeMatch && youtubeMatch[1]) { + const videoId = youtubeMatch[1].split("&")[0]; + const playlistMatch = url.match(/[?&]list=([^#&?]*)/); + const playlistId = playlistMatch ? playlistMatch[1] : null; + return { + type: "html", + value: `` + }; + } else { + return { + type: "html", + value: `` + }; + } + } + case "pdf": + return opts.pdfComponent ? { + type: "html", + value: `` + } : null; + default: + return null; + } +} +var RoamFlavoredMarkdown = (userOpts) => { + const opts = { ...defaultOptions, ...userOpts }; + return { + name: "RoamFlavoredMarkdown", + markdownPlugins() { + const plugins = []; + plugins.push(() => { + return (tree) => { + const replacements = []; + if (opts.audioComponent || opts.videoComponent || opts.pdfComponent) { + visit(tree, "paragraph", ((node, index, parent) => { + if (isSpecialEmbed(node)) { + const transformedNode = transformSpecialEmbed(node, opts); + if (transformedNode && parent) { + parent.children[index] = transformedNode; + } + } + })); + } + replacements.push([ + roamItalicRegex, + (_value, match) => ({ + type: "emphasis", + children: [{ type: "text", value: match }] + }) + ]); + replacements.push([ + roamHighlightRegex, + (_value, inner) => ({ + type: "html", + value: `${inner}` + }) + ]); + if (opts.orComponent) { + replacements.push([ + orRegex, + (match) => { + const matchResult = match.match(/{{or:(.*?)}}/); + if (matchResult === null || !matchResult[1]) { + return { type: "html", value: "" }; + } + const optionsString = matchResult[1]; + const options = optionsString.split("|"); + const selectHtml = ``; + return { type: "html", value: selectHtml }; + } + ]); + } + if (opts.TODOComponent) { + replacements.push([ + TODORegex, + () => ({ + type: "html", + value: `` + }) + ]); + } + if (opts.DONEComponent) { + replacements.push([ + DONERegex, + () => ({ + type: "html", + value: `` + }) + ]); + } + if (opts.blockquoteComponent) { + replacements.push([ + blockquoteRegex, + (_match, _marker, content) => ({ + type: "html", + value: `
${content.trim()}
` + }) + ]); + } + findAndReplace(tree, replacements); + }; + }); + return plugins; + } + }; +}; + +export { RoamFlavoredMarkdown }; +//# sourceMappingURL=index.js.map +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..f468ebb --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/transformer.ts"],"names":["mdastFindReplace"],"mappings":";;;;AAoBA,IAAM,cAAA,GAA8B;AAAA,EAClC,WAAA,EAAa,IAAA;AAAA,EACb,aAAA,EAAe,IAAA;AAAA,EACf,aAAA,EAAe,IAAA;AAAA,EACf,cAAA,EAAgB,IAAA;AAAA,EAChB,cAAA,EAAgB,IAAA;AAAA,EAChB,YAAA,EAAc,IAAA;AAAA,EACd,mBAAA,EAAqB,IAAA;AAAA,EACrB,cAAA,EAAgB,IAAA;AAAA,EAChB,kBAAA,EAAoB;AACtB,CAAA;AAEA,IAAM,OAAA,GAAU,IAAI,MAAA,CAAO,cAAA,EAAgB,GAAG,CAAA;AAC9C,IAAM,SAAA,GAAY,IAAI,MAAA,CAAO,oBAAA,EAAsB,GAAG,CAAA;AACtD,IAAM,SAAA,GAAY,IAAI,MAAA,CAAO,oBAAA,EAAsB,GAAG,CAAA;AAEtD,IAAM,eAAA,GAAkB,IAAI,MAAA,CAAO,oBAAA,EAAsB,GAAG,CAAA;AAC5D,IAAM,kBAAA,GAAqB,IAAI,MAAA,CAAO,cAAA,EAAgB,GAAG,CAAA;AACzD,IAAM,eAAA,GAAkB,IAAI,MAAA,CAAO,UAAA,EAAY,GAAG,CAAA;AAElD,SAAS,eAAe,IAAA,EAA0B;AAChD,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,KAAA;AAEvC,EAAA,MAAM,CA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A,IACT;AAAA,GACF;AACF","file":"index.js","sourcesContent":["import type { QuartzTransformerPlugin } from \"@quartz-community/types\";\nimport type { PluggableList } from \"unified\";\nimport { visit } from \"unist-util-visit\";\nimport type { ReplaceFunction } from \"mdast-util-find-and-replace\";\nimport { findAndReplace as mdastFindReplace } from \"mdast-util-find-and-replace\";\nimport type { Root, Html, Paragraph, Text, Link, Parent } from \"mdast\";\nimport type { BuildVisitor } from \"unist-util-visit\";\n\nexport interface RoamOptions {\n orComponent: boolean;\n TODOComponent: boolean;\n DONEComponent: boolean;\n videoComponent: boolean;\n audioComponent: boolean;\n pdfComponent: boolean;\n blockquoteComponent: boolean;\n tableComponent: boolean;\n attributeComponent: boolean;\n}\n\nconst defaultOptions: RoamOptions = {\n orComponent: true,\n TODOComponent: true,\n DONEComponent: true,\n videoComponent: true,\n audioComponent: true,\n pdfComponent: true,\n blockquoteComponent: true,\n tableComponent: true,\n attributeComponent: true,\n};\n\nconst orRegex = new RegExp(/{{or:(.*?)}}/, \"g\");\nconst TODORegex = new RegExp(/{{.*?\\bTODO\\b.*?}}/, \"g\");\nconst DONERegex = new RegExp(/{{.*?\\bDONE\\b.*?}}/, \"g\");\n\nconst blockquoteRegex = new RegExp(/(\\[\\[>\\]\\])\\s*(.*)/, \"g\");\nconst roamHighlightRegex = new RegExp(/\\^\\^(.+)\\^\\^/, \"g\");\nconst roamItalicRegex = new RegExp(/__(.+)__/, \"g\");\n\nfunction isSpecialEmbed(node: Paragraph): boolean {\n if (node.children.length !== 2) return false;\n\n const [textNode, linkNode] = node.children;\n return !!(\n textNode &&\n textNode.type === \"text\" &&\n textNode.value.startsWith(\"{{[[\") &&\n linkNode &&\n linkNode.type === \"link\" &&\n linkNode.children &&\n linkNode.children[0] &&\n linkNode.children[0].type === \"text\" &&\n linkNode.children[0].value.endsWith(\"}}\")\n );\n}\n\nfunction transformSpecialEmbed(node: Paragraph, opts: RoamOptions): Html | null {\n const [textNode, linkNode] = node.children as [Text, Link];\n const embedType = textNode.value.match(/\\{\\{\\[\\[(.*?)\\]\\]:/)?.[1]?.toLowerCase();\n const url = linkNode.url.slice(0, -2); // Remove the trailing '}}'\n\n switch (embedType) {\n case \"audio\":\n return opts.audioComponent\n ? {\n type: \"html\",\n value: ``,\n }\n : null;\n case \"video\": {\n if (!opts.videoComponent) return null;\n // Check if it's a YouTube video\n const youtubeMatch = url.match(\n /(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com|youtu\\.be)\\/(?:watch\\?v=)?(.+)/,\n );\n if (youtubeMatch && youtubeMatch[1]) {\n const videoId = youtubeMatch[1].split(\"&\")[0]; // Remove additional parameters\n const playlistMatch = url.match(/[?&]list=([^#&?]*)/);\n const playlistId = playlistMatch ? playlistMatch[1] : null;\n\n return {\n type: \"html\",\n value: ``,\n };\n } else {\n return {\n type: \"html\",\n value: ``,\n };\n }\n }\n case \"pdf\":\n return opts.pdfComponent\n ? {\n type: \"html\",\n value: ``,\n }\n : null;\n default:\n return null;\n }\n}\n\nexport const RoamFlavoredMarkdown: QuartzTransformerPlugin | undefined> = (\n userOpts,\n) => {\n const opts = { ...defaultOptions, ...userOpts };\n\n return {\n name: \"RoamFlavoredMarkdown\",\n markdownPlugins() {\n const plugins: PluggableList = [];\n\n plugins.push(() => {\n return (tree: Root) => {\n const replacements: [RegExp, ReplaceFunction][] = [];\n\n // Handle special embeds (audio, video, PDF)\n if (opts.audioComponent || opts.videoComponent || opts.pdfComponent) {\n visit(tree, \"paragraph\", ((node: Paragraph, index: number, parent: Parent | null) => {\n if (isSpecialEmbed(node)) {\n const transformedNode = transformSpecialEmbed(node, opts);\n if (transformedNode && parent) {\n parent.children[index] = transformedNode;\n }\n }\n }) as BuildVisitor);\n }\n\n // Roam italic syntax\n replacements.push([\n roamItalicRegex,\n (_value: string, match: string) => ({\n type: \"emphasis\",\n children: [{ type: \"text\", value: match }],\n }),\n ]);\n\n // Roam highlight syntax\n replacements.push([\n roamHighlightRegex,\n (_value: string, inner: string) => ({\n type: \"html\",\n value: `${inner}`,\n }),\n ]);\n\n if (opts.orComponent) {\n replacements.push([\n orRegex,\n (match: string) => {\n const matchResult = match.match(/{{or:(.*?)}}/);\n if (matchResult === null || !matchResult[1]) {\n return { type: \"html\", value: \"\" };\n }\n const optionsString: string = matchResult[1];\n const options: string[] = optionsString.split(\"|\");\n const selectHtml: string = ``;\n return { type: \"html\", value: selectHtml };\n },\n ]);\n }\n\n if (opts.TODOComponent) {\n replacements.push([\n TODORegex,\n () => ({\n type: \"html\",\n value: ``,\n }),\n ]);\n }\n\n if (opts.DONEComponent) {\n replacements.push([\n DONERegex,\n () => ({\n type: \"html\",\n value: ``,\n }),\n ]);\n }\n\n if (opts.blockquoteComponent) {\n replacements.push([\n blockquoteRegex,\n (_match: string, _marker: string, content: string) => ({\n type: \"html\",\n value: `
${content.trim()}
`,\n }),\n ]);\n }\n\n mdastFindReplace(tree, replacements);\n };\n });\n\n return plugins;\n },\n };\n};\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6c50503..114d6a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,7 @@ "license": "MIT", "dependencies": { "@quartz-community/types": "github:quartz-community/types", - "mdast": "^3.0.0", - "mdast-util-find-and-replace": "^3.0.1", - "tsup": "^8.5.0", - "typescript": "^5.9.3", - "unified": "^11.0.5", - "unist-util-visit": "^5.0.0" + "mdast": "^3.0.0" }, "devDependencies": { "@types/hast": "^3.0.4", @@ -27,6 +22,8 @@ "eslint-config-prettier": "^9.1.0", "preact": "^10.28.2", "prettier": "^3.6.2", + "tsup": "^8.5.0", + "typescript": "^5.9.3", "vitest": "^2.1.9" }, "engines": { @@ -35,14 +32,26 @@ }, "peerDependencies": { "@jackyzha0/quartz": "^4.5.2", - "preact": "^10.0.0" + "mdast-util-find-and-replace": "^3.0.1", + "preact": "^10.0.0", + "unified": "^11.0.5", + "unist-util-visit": "^5.0.0" }, "peerDependenciesMeta": { "@jackyzha0/quartz": { "optional": true }, + "mdast-util-find-and-replace": { + "optional": true + }, "preact": { "optional": false + }, + "unified": { + "optional": true + }, + "unist-util-visit": { + "optional": true } } }, @@ -2586,6 +2595,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "license": "MIT", + "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", @@ -2602,6 +2612,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "license": "MIT", + "optional": true, "engines": { "node": ">=12" }, @@ -2901,7 +2912,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -3593,6 +3603,7 @@ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", "license": "MIT", + "optional": true, "dependencies": { "@types/unist": "^3.0.0" }, @@ -3614,26 +3625,12 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-visit": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", - "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unist-util-visit-parents": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", "license": "MIT", + "optional": true, "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" diff --git a/package.json b/package.json index ec4b722..8773270 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "sideEffects": false, "scripts": { "build": "tsup", - "prepare": "npm run build", "dev": "tsup --watch", "lint": "eslint . --max-warnings=0", "format": "prettier . --check",