mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
Parsers work, tagpage/folderpage broken
This commit is contained in:
parent
7ed79cd27f
commit
c1c8e26722
@ -77,8 +77,8 @@ const config: QuartzConfig = {
|
|||||||
Plugin.AliasRedirects(),
|
Plugin.AliasRedirects(),
|
||||||
Plugin.ComponentResources(),
|
Plugin.ComponentResources(),
|
||||||
Plugin.ContentPage(),
|
Plugin.ContentPage(),
|
||||||
Plugin.FolderPage(),
|
//Plugin.FolderPage(),
|
||||||
Plugin.TagPage(),
|
//Plugin.TagPage(),
|
||||||
Plugin.ContentIndex({
|
Plugin.ContentIndex({
|
||||||
enableSiteMap: true,
|
enableSiteMap: true,
|
||||||
enableRSS: true,
|
enableRSS: true,
|
||||||
|
|||||||
@ -23,11 +23,11 @@ export const CustomDefault: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, _file) => {
|
||||||
mdastFindReplace(tree, replacements)
|
mdastFindReplace(tree, replacements)
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -42,9 +42,9 @@ export const ObsidianArrow: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
const plug: Pluggable = (tree: Root, _path) => {
|
const plug: Pluggable = (tree: Root, _path) => {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
|
||||||
replacements.push([
|
replacements.push([
|
||||||
arrowRegex,
|
arrowRegex,
|
||||||
(value: string, ..._capture: string[]) => {
|
(value: string, ..._capture: string[]) => {
|
||||||
@ -56,10 +56,9 @@ export const ObsidianArrow: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -27,11 +27,11 @@ export const ObsidianBlockReference: QuartzParser<Partial<Options>> = (userOpts)
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, _file) => {
|
||||||
mdastFindReplace(tree, replacements)
|
mdastFindReplace(tree, replacements)
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const inlineTagTypes = new Set(["p", "li"])
|
const inlineTagTypes = new Set(["p", "li"])
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { QuartzParser } from "../../types"
|
import { QuartzParser } from "../../types"
|
||||||
import { JSResource } from "../../../util/resources"
|
import { JSResource } from "../../../util/resources"
|
||||||
import { Root, BlockContent, DefinitionContent, Paragraph, Html } from "mdast"
|
import { Root, BlockContent, DefinitionContent, Paragraph, Html } from "mdast"
|
||||||
|
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
|
||||||
import { visit } from "unist-util-visit"
|
import { visit } from "unist-util-visit"
|
||||||
import { Pluggable } from "unified"
|
import { Pluggable } from "unified"
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -77,6 +78,7 @@ export const ObsidianCallouts: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
const plug: Pluggable = (tree: Root, _path) => {
|
const plug: Pluggable = (tree: Root, _path) => {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
visit(tree, "blockquote", (node) => {
|
visit(tree, "blockquote", (node) => {
|
||||||
@ -181,7 +183,7 @@ export const ObsidianCallouts: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -30,11 +30,11 @@ export const ObsidianCheckboxes: QuartzParser<Partial<Options>> = (userOpts) =>
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, _file) => {
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
|
|||||||
@ -33,13 +33,9 @@ export const ObsidianComments: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
|
||||||
if (opts.enabled) {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
const plug: Pluggable = (tree: Root, _file) => {}
|
||||||
}
|
return replacements
|
||||||
}
|
|
||||||
return plug
|
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -30,9 +30,9 @@ export const ObsidianHighlights: QuartzParser<Partial<Options>> = (userOpts) =>
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
const plug: Pluggable = (tree: Root, _path) => {
|
const plug: Pluggable = (tree: Root, _path) => {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
|
||||||
replacements.push([
|
replacements.push([
|
||||||
highlightRegex,
|
highlightRegex,
|
||||||
(_value: string, ...capture: string[]) => {
|
(_value: string, ...capture: string[]) => {
|
||||||
@ -43,10 +43,9 @@ export const ObsidianHighlights: QuartzParser<Partial<Options>> = (userOpts) =>
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { QuartzParser } from "../../types"
|
import { QuartzParser } from "../../types"
|
||||||
import { JSResource } from "../../../util/resources"
|
import { JSResource } from "../../../util/resources"
|
||||||
|
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
|
||||||
import { visit } from "unist-util-visit"
|
import { visit } from "unist-util-visit"
|
||||||
import { Root, Code } from "mdast"
|
import { Root, Code } from "mdast"
|
||||||
import { Pluggable } from "unified"
|
import { Pluggable } from "unified"
|
||||||
@ -25,6 +26,7 @@ export const ObsidianMermaid: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins() {
|
markdownPlugins() {
|
||||||
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
const plug: Pluggable = (tree: Root, _file) => {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
visit(tree, "code", (node: Code) => {
|
visit(tree, "code", (node: Code) => {
|
||||||
@ -38,7 +40,7 @@ export const ObsidianMermaid: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-
|
|||||||
import { FilePath, pathToRoot, slugTag, slugifyFilePath } from "../../../util/path"
|
import { FilePath, pathToRoot, slugTag, slugifyFilePath } from "../../../util/path"
|
||||||
import { JSResource } from "../../../util/resources"
|
import { JSResource } from "../../../util/resources"
|
||||||
import { Root } from "mdast"
|
import { Root } from "mdast"
|
||||||
|
import path from "path"
|
||||||
import { Pluggable } from "unified"
|
import { Pluggable } from "unified"
|
||||||
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
||||||
|
|
||||||
@ -35,9 +36,10 @@ export const ObsidianTags: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, file) => {
|
|
||||||
const base = pathToRoot(file.data.slug!)
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, file) => {
|
||||||
|
if (opts.enabled) {
|
||||||
|
const base = pathToRoot(file.data.slug!)
|
||||||
replacements.push([
|
replacements.push([
|
||||||
tagRegex,
|
tagRegex,
|
||||||
(_value: string, tag: string) => {
|
(_value: string, tag: string) => {
|
||||||
@ -69,9 +71,9 @@ export const ObsidianTags: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
|
||||||
}
|
}
|
||||||
return plug
|
}
|
||||||
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { JSResource } from "../../../util/resources"
|
|||||||
import { Root } from "mdast"
|
import { Root } from "mdast"
|
||||||
import { Pluggable } from "unified"
|
import { Pluggable } from "unified"
|
||||||
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
||||||
|
import path from "path"
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
enabled: Boolean
|
enabled: Boolean
|
||||||
@ -82,8 +83,9 @@ export const ObsidianWikilinks: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, path) => {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, file) => {
|
||||||
|
if (opts.enabled) {
|
||||||
replacements.push([
|
replacements.push([
|
||||||
wikilinkRegex,
|
wikilinkRegex,
|
||||||
(value: string, ...capture: string[]) => {
|
(value: string, ...capture: string[]) => {
|
||||||
@ -117,7 +119,9 @@ export const ObsidianWikilinks: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
type: "html",
|
type: "html",
|
||||||
value: `<video src="${url}" controls></video>`,
|
value: `<video src="${url}" controls></video>`,
|
||||||
}
|
}
|
||||||
} else if ([".mp3", ".webm", ".wav", ".m4a", ".ogg", ".3gp", ".flac"].includes(ext)) {
|
} else if (
|
||||||
|
[".mp3", ".webm", ".wav", ".m4a", ".ogg", ".3gp", ".flac"].includes(ext)
|
||||||
|
) {
|
||||||
return {
|
return {
|
||||||
type: "html",
|
type: "html",
|
||||||
value: `<audio src="${url}" controls></audio>`,
|
value: `<audio src="${url}" controls></audio>`,
|
||||||
@ -155,9 +159,9 @@ export const ObsidianWikilinks: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
|
||||||
}
|
}
|
||||||
return plug
|
}
|
||||||
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plug: Pluggable = () => {}
|
const plug: Pluggable = () => {}
|
||||||
|
|||||||
@ -28,11 +28,11 @@ export const ObsidianYouTube: QuartzParser<Partial<Options>> = (userOpts) => {
|
|||||||
return src
|
return src
|
||||||
},
|
},
|
||||||
markdownPlugins(_ctx) {
|
markdownPlugins(_ctx) {
|
||||||
const plug: Pluggable = (tree: Root, _file) => {
|
|
||||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
const plug: Pluggable = (tree: Root, _file) => {
|
||||||
mdastFindReplace(tree, replacements)
|
mdastFindReplace(tree, replacements)
|
||||||
}
|
}
|
||||||
return plug
|
return replacements
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
if (opts.enabled) {
|
if (opts.enabled) {
|
||||||
|
|||||||
@ -184,9 +184,10 @@ export const mdastFindReplaceInHtml = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
mdastFindReplace(tree, replacements)
|
mdastFindReplace(tree, replacements)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const CommonMarkFlavoredMarkdown: QuartzTransformerPlugin<Partial<CommonMarkOptions>> = (
|
export const CommonMarkFlavoredMarkdown: QuartzTransformerPlugin<Partial<CommonMarkOptions>> = (
|
||||||
userOpts,
|
userOpts,
|
||||||
@ -254,7 +255,9 @@ export const GitHubFlavoredMarkdown: QuartzTransformerPlugin<Partial<GitHubOptio
|
|||||||
markdownPlugins(ctx) {
|
markdownPlugins(ctx) {
|
||||||
const plugins: PluggableList = []
|
const plugins: PluggableList = []
|
||||||
|
|
||||||
plugins.push(GitHubSmartypants({ enabled: opts.enableSmartyPants }).markdownPlugins(ctx))
|
plugins.push(
|
||||||
|
GitHubSmartypants({ enabled: opts.enableSmartyPants }).markdownPlugins(ctx) as Pluggable,
|
||||||
|
)
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
},
|
},
|
||||||
@ -291,6 +294,27 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
|||||||
|
|
||||||
const inHtml = opts.enableInHtmlEmbed
|
const inHtml = opts.enableInHtmlEmbed
|
||||||
|
|
||||||
|
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
|
|
||||||
|
replacements.push.apply(
|
||||||
|
ObsidianWikilinks({ enabled: opts.wikilinks, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
|
)
|
||||||
|
replacements.push.apply(
|
||||||
|
ObsidianHighlights({ enabled: opts.highlight, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
|
)
|
||||||
|
replacements.push.apply(
|
||||||
|
ObsidianArrow({ enabled: opts.parseArrows, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
|
)
|
||||||
|
replacements.push.apply(
|
||||||
|
ObsidianTags({ enabled: opts.parseTags, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
|
)
|
||||||
|
|
||||||
|
plugins.push(() => {
|
||||||
|
return (tree: Root, file) => {
|
||||||
|
mdastFindReplaceInHtml(tree, replacements, inHtml)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/*plugins.push(() => {
|
/*plugins.push(() => {
|
||||||
return (tree: Root, file) => {
|
return (tree: Root, file) => {
|
||||||
//const replacements: [RegExp, string | ReplaceFunction][] = []
|
//const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||||
@ -305,7 +329,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
|||||||
//mdastFindReplace(tree, replacements)
|
//mdastFindReplace(tree, replacements)
|
||||||
}
|
}
|
||||||
})*/
|
})*/
|
||||||
plugins.push(
|
/*plugins.push(
|
||||||
ObsidianWikilinks({ enabled: opts.wikilinks, inHtml: inHtml }).markdownPlugins(ctx),
|
ObsidianWikilinks({ enabled: opts.wikilinks, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
)
|
)
|
||||||
plugins.push(
|
plugins.push(
|
||||||
@ -314,23 +338,35 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
|||||||
plugins.push(
|
plugins.push(
|
||||||
ObsidianArrow({ enabled: opts.parseArrows, inHtml: inHtml }).markdownPlugins(ctx),
|
ObsidianArrow({ enabled: opts.parseArrows, inHtml: inHtml }).markdownPlugins(ctx),
|
||||||
)
|
)
|
||||||
plugins.push(ObsidianTags({ enabled: opts.parseTags, inHtml: inHtml }).markdownPlugins(ctx))
|
plugins.push(ObsidianTags({ enabled: opts.parseTags, inHtml: inHtml }).markdownPlugins(ctx))*/
|
||||||
plugins.push(ObsidianVideo({ enabled: opts.enableVideoEmbed }).markdownPlugins(ctx))
|
plugins.push(() => {
|
||||||
plugins.push(ObsidianCallouts({ enabled: opts.callouts }).markdownPlugins(ctx))
|
return (tree: Root, file) =>
|
||||||
plugins.push(ObsidianMermaid({ enabled: opts.mermaid }).markdownPlugins(ctx))
|
ObsidianVideo({ enabled: opts.enableVideoEmbed }).markdownPlugins(ctx)
|
||||||
|
})
|
||||||
|
plugins.push(() => {
|
||||||
|
return (tree: Root, file) =>
|
||||||
|
ObsidianCallouts({ enabled: opts.callouts }).markdownPlugins(ctx)
|
||||||
|
})
|
||||||
|
plugins.push(() => {
|
||||||
|
return (tree: Root, file) => ObsidianMermaid({ enabled: opts.mermaid }).markdownPlugins(ctx)
|
||||||
|
})
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
const plugins: PluggableList = [rehypeRaw]
|
const plugins: PluggableList = [rehypeRaw]
|
||||||
|
|
||||||
plugins.push(
|
plugins.push(() => {
|
||||||
ObsidianBlockReference({ enabled: opts.parseBlockReferences }).htmlPlugins() as Pluggable,
|
return (tree: Root, file) =>
|
||||||
)
|
ObsidianBlockReference({ enabled: opts.parseBlockReferences }).htmlPlugins() as Pluggable
|
||||||
plugins.push(ObsidianYouTube({ enabled: opts.enableYouTubeEmbed }).htmlPlugins() as Pluggable)
|
})
|
||||||
plugins.push.apply(
|
plugins.push(() => {
|
||||||
ObsidianCheckboxes({ enabled: opts.enableCheckbox }).htmlPlugins() as Pluggable[],
|
return (tree: Root, file) =>
|
||||||
)
|
ObsidianYouTube({ enabled: opts.enableYouTubeEmbed }).htmlPlugins() as Pluggable
|
||||||
|
})
|
||||||
|
/*plugins.push(() => {
|
||||||
|
return (tree: HtmlRoot, file) => ObsidianCheckboxes({ enabled: opts.enableCheckbox }).htmlPlugins() as Pluggable}
|
||||||
|
)*/
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { PluggableList, Pluggable } from "unified"
|
import { PluggableList, Pluggable } from "unified"
|
||||||
import { JSResource, StaticResources } from "../util/resources"
|
import { JSResource, StaticResources } from "../util/resources"
|
||||||
|
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
|
||||||
import { ProcessedContent } from "./vfile"
|
import { ProcessedContent } from "./vfile"
|
||||||
import { QuartzComponent } from "../components/types"
|
import { QuartzComponent } from "../components/types"
|
||||||
import { FilePath } from "../util/path"
|
import { FilePath } from "../util/path"
|
||||||
@ -56,7 +57,7 @@ export type QuartzParser<Options extends OptionType = undefined> = (
|
|||||||
export type QuartzParserInstance = {
|
export type QuartzParserInstance = {
|
||||||
name: string
|
name: string
|
||||||
textTransform: (ctx: BuildCtx, src: string | Buffer) => string | Buffer
|
textTransform: (ctx: BuildCtx, src: string | Buffer) => string | Buffer
|
||||||
markdownPlugins: (ctx: BuildCtx) => Pluggable
|
markdownPlugins: (ctx: BuildCtx) => [RegExp, string | ReplaceFunction][]
|
||||||
htmlPlugins: () => Pluggable | Pluggable[]
|
htmlPlugins: () => Pluggable | Pluggable[]
|
||||||
externalResources: () => JSResource | string
|
externalResources: () => JSResource | string
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user