mdx
Generic MDX formatter for GraphQL documentation output.
Produces framework-neutral .mdx pages: plain Markdown and JSX-safe HTML,
with no framework components and no import declarations.
Header permalinks are escaped (\{#id\}) so that they remain valid MDX.
YAML front matter is kept, and internal links are rewritten to page-relative paths.
afterRenderTypeEntitiesHookβ
const afterRenderTypeEntitiesHook: RenderTypeEntitiesHook;
Defined in: mdx/index.ts:104
Rewrites absolute generated doc links to page-relative .mdx paths after each page is rendered.
formatMDXPermalinkβ
const formatMDXPermalink: (id) => MDXString = formatMDXEscapedPermalink;
Defined in: mdx/index.ts:97
Formats a header permalink with escaped braces (\{#id\}), valid in MDX.
Formats a permalink for a section header using the classic {#id} syntax,
escaped so that it stays valid MDX.
MDX parses an unescaped { as the start of an expression, and {#id} is not
a valid one, so presets generating .mdx pages must use this variant.
Parametersβ
idβ
string
The ID of the section header
Returnsβ
MDXString
Formatted permalink string
Exampleβ
formatMDXEscapedPermalink("my-id"); // \{#my-id\}
Paramβ
id
The ID of the section header
Returnsβ
Escaped permalink string
mdxExtensionβ
const mdxExtension: ".mdx" = ".mdx";
Defined in: mdx/index.ts:38
Generic MDX pages use the .mdx extension.
createMDXFormatter()β
function createMDXFormatter(_meta?): Formatter;
Defined in: mdx/index.ts:115
Creates a generic MDX formatter.
Parametersβ
_meta?β
Maybe<MetaInfo>
Unused metadata parameter
Returnsβ
Formatter
A complete Formatter implementation for generic MDX output
formatMDXAdmonition()β
function formatMDXAdmonition(admonition, _meta): MDXString;
Defined in: mdx/index.ts:46
Formats an admonition as a Markdown blockquote with a bold type/title label.
Parametersβ
admonitionβ
AdmonitionType
Admonition data with text, title, and type
_metaβ
Maybe<MetaInfo>
Unused metadata parameter
Returnsβ
MDXString
Formatted admonition string
formatMDXDetails()β
function formatMDXDetails(option): MDXString;
Defined in: mdx/index.ts:60
Formats a collapsible block as an HTML <details> element.
The output is split on \r by the printer into [openSection, closeSection].
Parametersβ
optionβ
CollapsibleOption
Configuration for open/close label text
Returnsβ
MDXString
Formatted collapsible string
formatMDXLink()β
function formatMDXLink(link): TypeLink;
Defined in: mdx/index.ts:72
Rewrites extensionless absolute links so they point to .mdx pages.
Parametersβ
linkβ
TypeLink
Link data with URL and text
Returnsβ
TypeLink
The link with .mdx appended to extensionless absolute paths