github fuma-nama/fumadocs fumadocs@16.17.8

  • @fumadocs/base-ui@16.17.8
  • fumadocs-core@16.17.8
  • fumadocs-ui@16.17.8

Bring your own highlighter

Shiki stays the default, and isn't loaded when you highlight code with another highlighter.

  • fumadocs-core/highlight exports a Highlighter interface, created with createHighlights() from fumadocs-core/highlight/highlights (@pierre/highlights) or createShikiHighlighter() from fumadocs-core/highlight/shiki, override() creates one with other options.
  • rehypeCodeFromHighlighter from fumadocs-core/mdx-plugins/rehype-code.core highlights code blocks with a highlighter, or a function creating one with the transformers of Fumadocs. createRehypeCode is deprecated, Sätteri has rehypeCodeFromHighlighter in @fumadocs/satteri/rehype-code. Pass transformerTwoslash() in its transformers option to analyze Twoslash blocks in batches.
  • createServerCodeBlock() and createDynamicCodeBlock() in Fumadocs UI create code blocks from a highlighter. Dynamic code blocks are highlighted on the server too.
  • toJsx() from fumadocs-core/utils/hast-to-jsx converts hast into React elements like toJsxRuntime() of hast-util-to-jsx-runtime, MDX nodes through an evaluator, over 10x faster on highlighted code, whose spans render as one HTML string. Every Fumadocs renderer uses it, hast-util-to-jsx-runtime is no longer a dependency.
  • Twoslash loads the languages of code blocks in popups before highlighting, an unknown language there no longer fails the code block.
  • OpenAPI Standalone highlights code blocks with Highlights, in its server-rendered pages too.
  • The page factories of OpenAPI, GraphQL and AsyncAPI, type tables, createPython(), createPythonComponents(), localHtml() and the shadcn createSnippet() take a highlighter.
  • Deprecated shiki and shikiOptions of the API pages and shiki of type tables, pass a highlighter instead.
  • Integrations require fumadocs-core 16.17.8, the API pages and shadcn also require fumadocs-ui 16.17.8.

remarkInclude in fumadocs-core

<include> moved from Fumadocs MDX to fumadocs-core/mdx-plugins/remark-include, a unified plugin for any MDX or Markdown pipeline.

  • fumadocs-mdx/config still exports remarkInclude, forwarded from fumadocs-core.
  • getProcessor parses included files by their format, like a .md file included in an .mdx page.
  • Headings in an included section get IDs unique among the page's own headings.
  • Circular includes throw instead of hanging, and included code files no longer end with an empty line.
  • fumadocs-mdx requires fumadocs-core 16.17.8.

Processed Markdown links page-relative images at their served URLs

  • Images imported by Remark Image get the URLs bundlers serve them at in Remark LLMs, instead of their relative paths
  • Stringifiers output JS expressions with s.expression(), for Markdown only known at runtime
  • Search records of included content with images are no longer cut
  • The Sätteri preset only imports images in bundlers, at runtime it resolves their sizes like the MDX preset

Don't miss a new fumadocs release

NewReleases is sending notifications on new releases.