Skip to main content

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


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


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