mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
chore(type): expose more options and fix copy katex
Apparently you have to set output to `htmlAndMathml` for `copy-tex` to work 🤷
This commit is contained in:
parent
92676d746e
commit
3e3cf96675
@ -2,10 +2,14 @@ import remarkMath from "remark-math"
|
|||||||
import rehypeKatex from "rehype-katex"
|
import rehypeKatex from "rehype-katex"
|
||||||
import rehypeMathjax from "rehype-mathjax/svg"
|
import rehypeMathjax from "rehype-mathjax/svg"
|
||||||
import { QuartzTransformerPlugin } from "../types"
|
import { QuartzTransformerPlugin } from "../types"
|
||||||
|
import { KatexOptions } from "katex"
|
||||||
|
import { Options as MathJaxOptions } from "rehype-mathjax/svg"
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
renderEngine: "katex" | "mathjax"
|
renderEngine: "katex" | "mathjax"
|
||||||
customMacros: MacroType
|
customMacros: MacroType
|
||||||
|
katexOptions: Omit<KatexOptions, "macros" | "output">
|
||||||
|
mathJaxOptions: MathJaxOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MacroType {
|
interface MacroType {
|
||||||
@ -22,9 +26,9 @@ export const Latex: QuartzTransformerPlugin<Partial<Options>> = (opts) => {
|
|||||||
},
|
},
|
||||||
htmlPlugins() {
|
htmlPlugins() {
|
||||||
if (engine === "katex") {
|
if (engine === "katex") {
|
||||||
return [[rehypeKatex, { output: "html", macros }]]
|
return [[rehypeKatex, { output: "htmlAndMathml", macros, ...(opts?.katexOptions ?? {}) }]]
|
||||||
} else {
|
} else {
|
||||||
return [[rehypeMathjax, { macros }]]
|
return [[rehypeMathjax, { macros, ...(opts?.mathJaxOptions ?? {}) }]]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
externalResources() {
|
externalResources() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user