| | |
| | | csl: "apa", |
| | | } |
| | | |
| | | export const Citations: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const Citations: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "Citations", |
| | |
| | | // using https://github.com/syntax-tree/unist-util-visit as they're just anochor links |
| | | plugins.push(() => { |
| | | return (tree, _file) => { |
| | | visit(tree, "element", (node, index, parent) => { |
| | | visit(tree, "element", (node, _index, _parent) => { |
| | | if (node.tagName === "a" && node.properties?.href?.startsWith("#bib")) { |
| | | node.properties["data-no-popover"] = true |
| | | } |
| | |
| | | "g", |
| | | ) |
| | | |
| | | export const Description: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const Description: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "Description", |
| | |
| | | .map((tag: string | number) => tag.toString()) |
| | | } |
| | | |
| | | export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "FrontMatter", |
| | |
| | | linkHeadings: true, |
| | | } |
| | | |
| | | export const GitHubFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | | export const GitHubFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "GitHubFlavoredMarkdown", |
| | |
| | | } |
| | | |
| | | type MaybeDate = undefined | string | number |
| | | export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | | export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "CreatedModifiedDate", |
| | |
| | | [key: string]: string |
| | | } |
| | | |
| | | export const Latex: QuartzTransformerPlugin<Options> = (opts?: Options) => { |
| | | export const Latex: QuartzTransformerPlugin<Partial<Options>> = (opts) => { |
| | | const engine = opts?.renderEngine ?? "katex" |
| | | const macros = opts?.customMacros ?? {} |
| | | return { |
| | |
| | | simplifySlug, |
| | | splitAnchor, |
| | | transformLink, |
| | | joinSegments, |
| | | } from "../../util/path" |
| | | import path from "path" |
| | | import { visit } from "unist-util-visit" |
| | |
| | | externalLinkIcon: true, |
| | | } |
| | | |
| | | export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "LinkProcessing", |
| | |
| | | /^(?<alt>(?!^\d*x?\d*$).*?)?(\|?\s*?(?<width>\d+)(x(?<height>\d+))?)?$/, |
| | | ) |
| | | |
| | | export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | | export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | |
| | | const mdastToHtml = (ast: PhrasingContent | Paragraph) => { |
| | |
| | | * markdown to make it compatible with quartz but the list of changes applied it |
| | | * is not exhaustive. |
| | | * */ |
| | | export const OxHugoFlavouredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | | export const OxHugoFlavouredMarkdown: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "OxHugoFlavouredMarkdown", |
| | |
| | | keepBackground: false, |
| | | } |
| | | |
| | | export const SyntaxHighlighting: QuartzTransformerPlugin<Options> = ( |
| | | userOpts?: Partial<Options>, |
| | | ) => { |
| | | const opts: Partial<CodeOptions> = { ...defaultOptions, ...userOpts } |
| | | export const SyntaxHighlighting: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts: CodeOptions = { ...defaultOptions, ...userOpts } |
| | | |
| | | return { |
| | | name: "SyntaxHighlighting", |
| | |
| | | } |
| | | |
| | | const slugAnchor = new Slugger() |
| | | export const TableOfContents: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | | export const TableOfContents: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "TableOfContents", |