docusaurus
Docusaurus MDX formatter for GraphQL documentation output.
Produces MDX markup compatible with Docusaurus v2 and v3, using Badge, Bullet, SpecifiedBy components and native admonition syntax.
mdxDeclarationβ
const mdxDeclaration: MDXString;
Defined in: docusaurus/index.ts:36
MDX component definitions prepended to every generated file.
createMDXFormatter()β
function createMDXFormatter(meta?): Formatter;
Defined in: docusaurus/index.ts:162
Creates a Docusaurus formatter.
Captures meta in closure so formatMDXAdmonition can detect the Docusaurus version.
Parametersβ
meta?β
Maybe<MetaInfo>
Optional metadata used to detect Docusaurus version
Returnsβ
Formatter
A complete Formatter implementation for Docusaurus MDX output
formatMDXAdmonition()β
function formatMDXAdmonition(admonition, meta): MDXString;
Defined in: docusaurus/index.ts:65
Formats an admonition using Docusaurus native :::type callout syntax.
Detects Docusaurus v2 (via meta) and uses :::caution instead of :::warning.
Parametersβ
admonitionβ
AdmonitionType
Admonition data with text, title, and type
metaβ
Maybe<MetaInfo>
Optional metadata used to detect Docusaurus version
Returnsβ
MDXString
Formatted admonition string
formatMDXBadge()β
function formatMDXBadge(badge): MDXString;
Defined in: docusaurus/index.ts:52
Formats a badge using the inline <Badge> component defined in mdxDeclaration.
Appends a CSS class derived from classname (e.g. badge--deprecated).
Parametersβ
badgeβ
Badge
Badge data containing text and optional classname
Returnsβ
MDXString
Formatted Badge component string
formatMDXBullet()β
function formatMDXBullet(text?): MDXString;
Defined in: docusaurus/index.ts:82
Formats a bullet point using the inline <Bullet/> component defined in mdxDeclaration.
Parametersβ
text?β
string = ""
Optional text to append after the bullet
Returnsβ
MDXString
Formatted Bullet component string
formatMDXDetails()β
function formatMDXDetails(option): MDXString;
Defined in: docusaurus/index.ts:93
Formats a collapsible block as an HTML <details> element with
toggle labels that swap via the hidden attribute.
Text is escaped so curly braces and angle brackets don't break MDX.
Parametersβ
optionβ
CollapsibleOption
Configuration for open/close label text
Returnsβ
MDXString
Formatted details element string
formatMDXFrontmatter()β
function formatMDXFrontmatter(_props, formatted): MDXString;
Defined in: docusaurus/index.ts:145
Formats YAML front matter wrapped in --- delimiters.
Parametersβ
_propsβ
Maybe<FrontMatterOptions>
Front matter options (unused)
formattedβ
Maybe<string[]>
Pre-formatted front matter lines
Returnsβ
MDXString
Formatted front matter block, or empty string if no lines provided
formatMDXLink()β
function formatMDXLink(link): TypeLink;
Defined in: docusaurus/index.ts:132
Appends .mdx to internal link URLs.
Parametersβ
linkβ
TypeLink
Link data with URL and text
Returnsβ
TypeLink
Link with .mdx extension appended to the URL
formatMDXNameEntity()β
function formatMDXNameEntity(name, parentType?): MDXString;
Defined in: docusaurus/index.ts:119
Formats a named entity as an inline <code> element with the parent type
in normal weight and the entity name in bold.
Text is escaped so curly braces don't break MDX.
Parametersβ
nameβ
string
Entity name
parentType?β
Maybe<string>
Optional parent type name for qualified references
Returnsβ
MDXString
Formatted JSX code element string
formatMDXSpecifiedByLink()β
function formatMDXSpecifiedByLink(url): MDXString;
Defined in: docusaurus/index.ts:107
Formats a "specified by" link using the inline <SpecifiedBy> component.
Parametersβ
urlβ
string
URL to the specification
Returnsβ
MDXString
Formatted SpecifiedBy component string