vocs
Vocs formatter for GraphQL documentation output.
Produces MDX compatible with Vite/Vocs using its native callout syntax
formatMDXPermalink
const formatMDXPermalink: typeof formatMDXEscapedPermalink =
formatMDXEscapedPermalink;
Defined in: vocs/index.ts:40
Formats a permalink for a section header, using the classic {#id} syntax
escaped to remain valid MDX.
Vocs has no custom header id syntax, so the permalink is inert unless a
remark plugin is configured. Turn it off with
docOptions.sectionHeaderId: false.
See
https://vocs.dev/docs/markdown
Param
id
The ID of the section header
Returns
Formatted permalink string
mdxDeclaration
const mdxDeclaration: MDXString;
Defined in: vocs/index.ts:44
MDX import statement and inline component definitions prepended to every generated file.
mdxExtension
const mdxExtension: ".mdx";
Defined in: vocs/index.ts:49
File extension used for generated pages.
createMDXFormatter()
function createMDXFormatter(_meta?): Formatter;
Defined in: vocs/index.ts:141
Creates a Vocs formatter.
Parameters
_meta?
Maybe<MetaInfo>
Unused metadata parameter
Returns
Formatter
A complete Formatter implementation for Vocs MDX output
formatMDXAdmonition()
function formatMDXAdmonition(admonition, _meta): MDXString;
Defined in: vocs/index.ts:85
Formats an admonition using Vocs native callout syntax (:::type[title]).
Maps warning type to warning; all other types use info.
Parameters
admonition
AdmonitionType
Admonition data with text, title, and type
_meta
Maybe<MetaInfo>
Unused metadata parameter
Returns
MDXString
Formatted Vocs callout string
formatMDXBadge()
function formatMDXBadge(badge): MDXString;
Defined in: vocs/index.ts:73
Formats a badge using Vocs native text directive (:badge[...]).
Maps DEPRECATED classname to warning color; all others use default.
Parameters
badge
Badge
Badge data containing text and optional classname
Returns
MDXString
Formatted Vocs badge string
formatMDXBullet()
function formatMDXBullet(text?): MDXString;
Defined in: vocs/index.ts:98
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
formatMDXLink()
function formatMDXLink(link): TypeLink;
Defined in: vocs/index.ts:107
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: vocs/index.ts:120
Formats a named entity as a JSX span with styled code elements.
Parameters
name
string
Entity name
parentType?
Maybe<string>
Optional parent type name for qualified references
Returns
MDXString
Formatted JSX entity reference string
formatMDXTitle()
function formatMDXTitle(title): MDXString;
Defined in: vocs/index.ts:63
Formats the page title as a visible # Title heading.
Vocs only uses the front matter title for the document <title>; the
page heading must be written in Markdown, so without it generated pages
have no visible title.
Parameters
title
string
The page title
Returns
MDXString
# Title heading