Skip to content
Foldocs
On this pageMath and diagrams
Markdown

Advanced authoring

Combine built-in math and diagrams with dynamic code, typed API tables, and image metadata.

Foldocs compiles these features at build time wherever possible. The static HTML remains readable before the Foldkit runtime starts.

Math and diagrams

Math is compiled to accessible KaTeX markup, while Mermaid diagrams retain a readable source fallback and load the browser renderer only on routes that contain diagrams.

Dynamic highlighted code

Use DynamicCodeBlock when generated content supplies a literal code string. It goes through the same Shiki pipeline as a fenced code block.

ts
const answer: number = 42

Type tables

Type tables use deterministic nested components, so they can be indexed and serialized without executing JavaScript in MDX.

PropertyTypeDefaultDescription
titlestringDisplayed page title.
draftbooleanfalseExcludes the page from production output.

Image metadata and zoom

Relative images are inspected during compilation. Foldocs writes intrinsic width and height attributes to prevent layout shift, then opens the image in an accessible full-screen preview when selected.

Last updated Aug 2, 2026