mdx
createMDXFormatter()β
function createMDXFormatter(meta?): Formatter;
Defined in: mdx/index.ts:159
Creates an MDX formatter for Docusaurus documentation.
The MDX formatter produces MDX/HTML markup compatible with Docusaurus.
It uses helper components like <Badge>, <Bullet>, and <SpecifiedBy>,
and emits native <details>/<summary> blocks for collapsible sections.
Parametersβ
meta?β
Maybe<MetaInfo>
Optional metadata for framework-specific formatting
Returnsβ
Formatter
A complete Formatter implementation for MDX output
Exampleβ
import { createMDXFormatter } from "@graphql-markdown/docusaurus";
const formatter = createMDXFormatter({ generatorFrameworkName: "docusaurus" });
const badge = formatter.formatMDXBadge({ text: "Required" });
// '<Badge class="badge badge--secondary " text="Required"/>'
formatMDXAdmonition()β
function formatMDXAdmonition(param, meta): MDXString;
Defined in: mdx/index.ts:52
Formats an admonition block in MDX format
Parametersβ
paramβ
AdmonitionType
The admonition configuration object
metaβ
Maybe<MetaInfo>
Optional metadata for generator configuration
Returnsβ
MDXString
Formatted MDX string for the admonition
formatMDXBadge()β
function formatMDXBadge(param): MDXString;
Defined in: mdx/index.ts:40
Formats a Badge inline-block in MDX format
Parametersβ
paramβ
Badge
The badge configuration object
Returnsβ
MDXString
Formatted MDX string for the badge
formatMDXBullet()β
function formatMDXBullet(text?): MDXString;
Defined in: mdx/index.ts:69
Creates a bullet point element in MDX format
Parametersβ
text?β
string = ""
Optional text to append after the bullet point
Returnsβ
MDXString
Formatted MDX string for the bullet point
formatMDXDetails()β
function formatMDXDetails(param): MDXString;
Defined in: mdx/index.ts:78
Creates a collapsible details section in MDX format
Parametersβ
paramβ
CollapsibleOption
The collapsible section configuration
Returnsβ
MDXString
Formatted MDX string for the collapsible section
formatMDXFrontmatter()β
function formatMDXFrontmatter(_props, formatted): MDXString;
Defined in: mdx/index.ts:129
Default frontmatter formatter for MDX.
Parametersβ
_propsβ
Maybe<FrontMatterOptions>
The front matter options (unused)
formattedβ
Maybe<string[]>
The formatted front matter as an array of strings
Returnsβ
MDXString
Formatted MDX string for the front matter
formatMDXLink()β
function formatMDXLink(param): TypeLink;
Defined in: mdx/index.ts:115
Formats a link in MDX format
Parametersβ
paramβ
TypeLink
The link configuration object
Returnsβ
TypeLink
Formatted MDX link object
formatMDXNameEntity()β
function formatMDXNameEntity(name, parentType?): MDXString;
Defined in: mdx/index.ts:102
Formats a name entity with optional parent type
Parametersβ
nameβ
string
The name to format
parentType?β
Maybe<string>
Optional parent type to prefix the name
Returnsβ
MDXString
Formatted MDX string for the name entity
formatMDXSpecifiedByLink()β
function formatMDXSpecifiedByLink(url): MDXString;
Defined in: mdx/index.ts:92
Creates a link to the specification documentation
Parametersβ
urlβ
string
The URL to the specification
Returnsβ
MDXString
Formatted MDX string for the specification link