mdx
createMDXFormatter()
function createMDXFormatter(meta?): Formatter;
Defined in: mdx/index.ts:156
Creates an MDX formatter for Docusaurus documentation.
The MDX formatter produces React component-based markup compatible
with Docusaurus MDX rendering. It uses components like <Badge>,
<Bullet>, <Details>, and <SpecifiedBy>.
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:51
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:39
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:68
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:77
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:126
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:112
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:99
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:89
Creates a link to the specification documentation
Parameters
url
string
The URL to the specification
Returns
MDXString
Formatted MDX string for the specification link