mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06: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.ComponentResources(),
|
||||
Plugin.ContentPage(),
|
||||
Plugin.FolderPage(),
|
||||
Plugin.TagPage(),
|
||||
//Plugin.FolderPage(),
|
||||
//Plugin.TagPage(),
|
||||
Plugin.ContentIndex({
|
||||
enableSiteMap: true,
|
||||
enableRSS: true,
|
||||
|
||||
@ -23,11 +23,11 @@ export const CustomDefault: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
mdastFindReplace(tree, replacements)
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -42,9 +42,9 @@ export const ObsidianArrow: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _path) => {
|
||||
if (opts.enabled) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
replacements.push([
|
||||
arrowRegex,
|
||||
(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() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -27,11 +27,11 @@ export const ObsidianBlockReference: QuartzParser<Partial<Options>> = (userOpts)
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
mdastFindReplace(tree, replacements)
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const inlineTagTypes = new Set(["p", "li"])
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { QuartzParser } from "../../types"
|
||||
import { JSResource } from "../../../util/resources"
|
||||
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 { Pluggable } from "unified"
|
||||
// @ts-ignore
|
||||
@ -77,6 +78,7 @@ export const ObsidianCallouts: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _path) => {
|
||||
if (opts.enabled) {
|
||||
visit(tree, "blockquote", (node) => {
|
||||
@ -181,7 +183,7 @@ export const ObsidianCallouts: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -30,11 +30,11 @@ export const ObsidianCheckboxes: QuartzParser<Partial<Options>> = (userOpts) =>
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
if (opts.enabled) {
|
||||
|
||||
@ -33,13 +33,9 @@ export const ObsidianComments: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
if (opts.enabled) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
||||
}
|
||||
}
|
||||
return plug
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {}
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -30,9 +30,9 @@ export const ObsidianHighlights: QuartzParser<Partial<Options>> = (userOpts) =>
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _path) => {
|
||||
if (opts.enabled) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
replacements.push([
|
||||
highlightRegex,
|
||||
(_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() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { QuartzParser } from "../../types"
|
||||
import { JSResource } from "../../../util/resources"
|
||||
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { Root, Code } from "mdast"
|
||||
import { Pluggable } from "unified"
|
||||
@ -25,6 +26,7 @@ export const ObsidianMermaid: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins() {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
if (opts.enabled) {
|
||||
visit(tree, "code", (node: Code) => {
|
||||
@ -38,7 +40,7 @@ export const ObsidianMermaid: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -3,6 +3,7 @@ import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-
|
||||
import { FilePath, pathToRoot, slugTag, slugifyFilePath } from "../../../util/path"
|
||||
import { JSResource } from "../../../util/resources"
|
||||
import { Root } from "mdast"
|
||||
import path from "path"
|
||||
import { Pluggable } from "unified"
|
||||
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
||||
|
||||
@ -35,43 +36,44 @@ export const ObsidianTags: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, file) => {
|
||||
const base = pathToRoot(file.data.slug!)
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
replacements.push([
|
||||
tagRegex,
|
||||
(_value: string, tag: string) => {
|
||||
// Check if the tag only includes numbers and slashes
|
||||
if (/^[\/\d]+$/.test(tag)) {
|
||||
return false
|
||||
}
|
||||
if (opts.enabled) {
|
||||
const base = pathToRoot(file.data.slug!)
|
||||
replacements.push([
|
||||
tagRegex,
|
||||
(_value: string, tag: string) => {
|
||||
// Check if the tag only includes numbers and slashes
|
||||
if (/^[\/\d]+$/.test(tag)) {
|
||||
return false
|
||||
}
|
||||
|
||||
tag = slugTag(tag)
|
||||
if (file.data.frontmatter) {
|
||||
const noteTags = file.data.frontmatter.tags ?? []
|
||||
file.data.frontmatter.tags = [...new Set([...noteTags, tag])]
|
||||
}
|
||||
tag = slugTag(tag)
|
||||
if (file.data.frontmatter) {
|
||||
const noteTags = file.data.frontmatter.tags ?? []
|
||||
file.data.frontmatter.tags = [...new Set([...noteTags, tag])]
|
||||
}
|
||||
|
||||
return {
|
||||
type: "link",
|
||||
url: base + `/tags/${tag}`,
|
||||
data: {
|
||||
hProperties: {
|
||||
className: ["tag-link"],
|
||||
return {
|
||||
type: "link",
|
||||
url: base + `/tags/${tag}`,
|
||||
data: {
|
||||
hProperties: {
|
||||
className: ["tag-link"],
|
||||
},
|
||||
},
|
||||
},
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
value: tag,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
])
|
||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
value: tag,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
])
|
||||
}
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -5,6 +5,7 @@ import { JSResource } from "../../../util/resources"
|
||||
import { Root } from "mdast"
|
||||
import { Pluggable } from "unified"
|
||||
import { mdastFindReplaceInHtml } from "../../transformers/markdown"
|
||||
import path from "path"
|
||||
|
||||
interface Options {
|
||||
enabled: Boolean
|
||||
@ -82,82 +83,85 @@ export const ObsidianWikilinks: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const plug: Pluggable = (tree: Root, path) => {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
replacements.push([
|
||||
wikilinkRegex,
|
||||
(value: string, ...capture: string[]) => {
|
||||
let [rawFp, rawHeader, rawAlias] = capture
|
||||
const fp = rawFp?.trim() ?? ""
|
||||
const anchor = rawHeader?.trim() ?? ""
|
||||
const alias = rawAlias?.slice(1).trim()
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, file) => {
|
||||
if (opts.enabled) {
|
||||
replacements.push([
|
||||
wikilinkRegex,
|
||||
(value: string, ...capture: string[]) => {
|
||||
let [rawFp, rawHeader, rawAlias] = capture
|
||||
const fp = rawFp?.trim() ?? ""
|
||||
const anchor = rawHeader?.trim() ?? ""
|
||||
const alias = rawAlias?.slice(1).trim()
|
||||
|
||||
// embed cases
|
||||
if (value.startsWith("!")) {
|
||||
const ext: string = path.extname(fp).toLowerCase()
|
||||
const url = slugifyFilePath(fp as FilePath)
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) {
|
||||
const match = wikilinkImageEmbedRegex.exec(alias ?? "")
|
||||
const alt = match?.groups?.alt ?? ""
|
||||
const width = match?.groups?.width ?? "auto"
|
||||
const height = match?.groups?.height ?? "auto"
|
||||
return {
|
||||
type: "image",
|
||||
url,
|
||||
data: {
|
||||
hProperties: {
|
||||
width,
|
||||
height,
|
||||
alt,
|
||||
// embed cases
|
||||
if (value.startsWith("!")) {
|
||||
const ext: string = path.extname(fp).toLowerCase()
|
||||
const url = slugifyFilePath(fp as FilePath)
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) {
|
||||
const match = wikilinkImageEmbedRegex.exec(alias ?? "")
|
||||
const alt = match?.groups?.alt ?? ""
|
||||
const width = match?.groups?.width ?? "auto"
|
||||
const height = match?.groups?.height ?? "auto"
|
||||
return {
|
||||
type: "image",
|
||||
url,
|
||||
data: {
|
||||
hProperties: {
|
||||
width,
|
||||
height,
|
||||
alt,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
} else if ([".mp4", ".webm", ".ogv", ".mov", ".mkv"].includes(ext)) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<video src="${url}" controls></video>`,
|
||||
}
|
||||
} else if ([".mp3", ".webm", ".wav", ".m4a", ".ogg", ".3gp", ".flac"].includes(ext)) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<audio src="${url}" controls></audio>`,
|
||||
}
|
||||
} else if ([".pdf"].includes(ext)) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<iframe src="${url}" class="pdf"></iframe>`,
|
||||
}
|
||||
} else {
|
||||
const block = anchor
|
||||
return {
|
||||
type: "html",
|
||||
data: { hProperties: { transclude: true } },
|
||||
value: `<blockquote class="transclude" data-url="${url}" data-block="${block}" data-embed-alias="${alias}"><a href="${
|
||||
url + anchor
|
||||
}" class="transclude-inner">Transclude of ${url}${block}</a></blockquote>`,
|
||||
}
|
||||
} else if ([".mp4", ".webm", ".ogv", ".mov", ".mkv"].includes(ext)) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<video src="${url}" controls></video>`,
|
||||
}
|
||||
} else if (
|
||||
[".mp3", ".webm", ".wav", ".m4a", ".ogg", ".3gp", ".flac"].includes(ext)
|
||||
) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<audio src="${url}" controls></audio>`,
|
||||
}
|
||||
} else if ([".pdf"].includes(ext)) {
|
||||
return {
|
||||
type: "html",
|
||||
value: `<iframe src="${url}" class="pdf"></iframe>`,
|
||||
}
|
||||
} else {
|
||||
const block = anchor
|
||||
return {
|
||||
type: "html",
|
||||
data: { hProperties: { transclude: true } },
|
||||
value: `<blockquote class="transclude" data-url="${url}" data-block="${block}" data-embed-alias="${alias}"><a href="${
|
||||
url + anchor
|
||||
}" class="transclude-inner">Transclude of ${url}${block}</a></blockquote>`,
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise, fall through to regular link
|
||||
}
|
||||
|
||||
// otherwise, fall through to regular link
|
||||
}
|
||||
|
||||
// internal link
|
||||
const url = fp + anchor
|
||||
return {
|
||||
type: "link",
|
||||
url,
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
value: alias ?? fp,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
])
|
||||
mdastFindReplaceInHtml(tree, replacements, opts.inHtml)
|
||||
// internal link
|
||||
const url = fp + anchor
|
||||
return {
|
||||
type: "link",
|
||||
url,
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
value: alias ?? fp,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
])
|
||||
}
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plug: Pluggable = () => {}
|
||||
|
||||
@ -28,11 +28,11 @@ export const ObsidianYouTube: QuartzParser<Partial<Options>> = (userOpts) => {
|
||||
return src
|
||||
},
|
||||
markdownPlugins(_ctx) {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
const plug: Pluggable = (tree: Root, _file) => {
|
||||
const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
mdastFindReplace(tree, replacements)
|
||||
}
|
||||
return plug
|
||||
return replacements
|
||||
},
|
||||
htmlPlugins() {
|
||||
if (opts.enabled) {
|
||||
|
||||
@ -184,8 +184,9 @@ export const mdastFindReplaceInHtml = (
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
mdastFindReplace(tree, replacements)
|
||||
}
|
||||
mdastFindReplace(tree, replacements)
|
||||
}
|
||||
|
||||
export const CommonMarkFlavoredMarkdown: QuartzTransformerPlugin<Partial<CommonMarkOptions>> = (
|
||||
@ -254,7 +255,9 @@ export const GitHubFlavoredMarkdown: QuartzTransformerPlugin<Partial<GitHubOptio
|
||||
markdownPlugins(ctx) {
|
||||
const plugins: PluggableList = []
|
||||
|
||||
plugins.push(GitHubSmartypants({ enabled: opts.enableSmartyPants }).markdownPlugins(ctx))
|
||||
plugins.push(
|
||||
GitHubSmartypants({ enabled: opts.enableSmartyPants }).markdownPlugins(ctx) as Pluggable,
|
||||
)
|
||||
|
||||
return plugins
|
||||
},
|
||||
@ -291,6 +294,27 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
||||
|
||||
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(() => {
|
||||
return (tree: Root, file) => {
|
||||
//const replacements: [RegExp, string | ReplaceFunction][] = []
|
||||
@ -305,7 +329,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
||||
//mdastFindReplace(tree, replacements)
|
||||
}
|
||||
})*/
|
||||
plugins.push(
|
||||
/*plugins.push(
|
||||
ObsidianWikilinks({ enabled: opts.wikilinks, inHtml: inHtml }).markdownPlugins(ctx),
|
||||
)
|
||||
plugins.push(
|
||||
@ -314,23 +338,35 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<ObsidianO
|
||||
plugins.push(
|
||||
ObsidianArrow({ enabled: opts.parseArrows, inHtml: inHtml }).markdownPlugins(ctx),
|
||||
)
|
||||
plugins.push(ObsidianTags({ enabled: opts.parseTags, inHtml: inHtml }).markdownPlugins(ctx))
|
||||
plugins.push(ObsidianVideo({ enabled: opts.enableVideoEmbed }).markdownPlugins(ctx))
|
||||
plugins.push(ObsidianCallouts({ enabled: opts.callouts }).markdownPlugins(ctx))
|
||||
plugins.push(ObsidianMermaid({ enabled: opts.mermaid }).markdownPlugins(ctx))
|
||||
plugins.push(ObsidianTags({ enabled: opts.parseTags, inHtml: inHtml }).markdownPlugins(ctx))*/
|
||||
plugins.push(() => {
|
||||
return (tree: Root, file) =>
|
||||
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
|
||||
},
|
||||
htmlPlugins() {
|
||||
const plugins: PluggableList = [rehypeRaw]
|
||||
|
||||
plugins.push(
|
||||
ObsidianBlockReference({ enabled: opts.parseBlockReferences }).htmlPlugins() as Pluggable,
|
||||
)
|
||||
plugins.push(ObsidianYouTube({ enabled: opts.enableYouTubeEmbed }).htmlPlugins() as Pluggable)
|
||||
plugins.push.apply(
|
||||
ObsidianCheckboxes({ enabled: opts.enableCheckbox }).htmlPlugins() as Pluggable[],
|
||||
)
|
||||
plugins.push(() => {
|
||||
return (tree: Root, file) =>
|
||||
ObsidianBlockReference({ enabled: opts.parseBlockReferences }).htmlPlugins() as Pluggable
|
||||
})
|
||||
plugins.push(() => {
|
||||
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
|
||||
},
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { PluggableList, Pluggable } from "unified"
|
||||
import { JSResource, StaticResources } from "../util/resources"
|
||||
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
|
||||
import { ProcessedContent } from "./vfile"
|
||||
import { QuartzComponent } from "../components/types"
|
||||
import { FilePath } from "../util/path"
|
||||
@ -56,7 +57,7 @@ export type QuartzParser<Options extends OptionType = undefined> = (
|
||||
export type QuartzParserInstance = {
|
||||
name: string
|
||||
textTransform: (ctx: BuildCtx, src: string | Buffer) => string | Buffer
|
||||
markdownPlugins: (ctx: BuildCtx) => Pluggable
|
||||
markdownPlugins: (ctx: BuildCtx) => [RegExp, string | ReplaceFunction][]
|
||||
htmlPlugins: () => Pluggable | Pluggable[]
|
||||
externalResources: () => JSResource | string
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user