mdbook
mdBook formatter for GraphQL documentation output.
Produces Markdown compatible with Rust's mdBook static site generator.
Front matter is suppressed because mdBook renders it as literal content.
Admonitions use mdBook's native > [!TYPE] syntax.
Exports afterRenderFilesHook to build SUMMARY.md after all pages are written.
afterRenderFilesHookβ
const afterRenderFilesHook: RenderFilesHook;
Defined in: mdbook/index.ts:164
Builds src/SUMMARY.md after all pages have been written.
mdBook requires every page to be listed in SUMMARY.md before the site can
be built. This hook collects all rendered pages from the event, groups them
by top-level section (Operations / Types) and category, then writes the file.
mdxExtensionβ
const mdxExtension: ".md" = ".md";
Defined in: mdbook/index.ts:101
mdBook expects .md files; override the default .mdx extension.
createMDXFormatter()β
function createMDXFormatter(_meta?): Formatter;
Defined in: mdbook/index.ts:131
Creates an mdBook formatter.
Parametersβ
_meta?β
Maybe<MetaInfo>
Unused metadata parameter
Returnsβ
Formatter
A complete Formatter implementation for mdBook output
formatMDXAdmonition()β
function formatMDXAdmonition(admonition, _meta): MDXString;
Defined in: mdbook/index.ts:59
Formats an admonition using mdBook's native admonition syntax (> [!TYPE]).
Uses type for the admonition tag and title as an optional override label.
Parametersβ
admonitionβ
AdmonitionType
Admonition data with text, title, and type
_metaβ
Maybe<MetaInfo>
Unused metadata parameter
Returnsβ
MDXString
Formatted admonition string
formatMDXBadge()β
function formatMDXBadge(badge): MDXString;
Defined in: mdbook/index.ts:48
Formats a badge as Markdown bold text β mdBook has no badge component.
Parametersβ
badgeβ
Badge
Badge data containing text
Returnsβ
MDXString
Formatted bold text string
formatMDXDetails()β
function formatMDXDetails(option): MDXString;
Defined in: mdbook/index.ts:80
Renders a deprecated section as a bold inline label.
A fixed heading level would break hierarchy when this section is nested inside field entries at varying depths. Bold text is CommonMark-safe and works at any nesting level without affecting the heading outline.
The output is split on \r to produce [openSection, closeSection] as the
printer expects β the deprecated items are inserted between the two halves.
Parametersβ
optionβ
CollapsibleOption
Configuration for the section label
Returnsβ
MDXString
Bold label + split marker
formatMDXFrontmatter()β
function formatMDXFrontmatter(_props, formatted): MDXString;
Defined in: mdbook/index.ts:92
Replaces front matter with an H1 title heading.
mdBook renders --- YAML blocks as literal content, so front matter is
suppressed entirely. The page title is emitted as # Title instead.
Parametersβ
_propsβ
Maybe<FrontMatterOptions>
formattedβ
Maybe<string[]>
Returnsβ
MDXString
# Title\n when a title is available, otherwise an empty string
formatMDXLink()β
function formatMDXLink(link): TypeLink;
Defined in: mdbook/index.ts:108
Returns the link unchanged β mdBook resolves .md links natively.
Parametersβ
linkβ
TypeLink
Link data with URL and text
Returnsβ
TypeLink
The link with .md appended to extensionless absolute paths