UNPKG

@graphql-markdown/docusaurus

Version:

Docusaurus plugin for generating Markdown documentation from a GraphQL schema.

46 lines (45 loc) 2.11 kB
/** * @module mdx * This module provides utilities for generating MDX content in Docusaurus format. * It includes functions for creating badges, admonitions, bullet points, collapsible sections, * specification links, and other MDX-specific formatting for GraphQL documentation. * * @primaryExport */ import type { AdmonitionType, Badge, CollapsibleOption, Maybe, MDXString, MetaOptions, TypeLink } from "@graphql-markdown/types"; export { mdxDeclaration } from "./components"; export { generateIndexMetafile } from "./category"; export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString; /** * Formats an admonition block in MDX format * @param param - The admonition configuration object * @param meta - Optional metadata for generator configuration * @returns Formatted MDX string for the admonition */ export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, meta: Maybe<MetaOptions>) => MDXString; /** * Creates a bullet point element in MDX format * @param text - Optional text to append after the bullet point * @returns Formatted MDX string for the bullet point */ export declare const formatMDXBullet: (text?: string) => MDXString; /** * Creates a collapsible details section in MDX format * @param param - The collapsible section configuration * @returns Formatted MDX string for the collapsible section */ export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString; /** * Creates a link to the specification documentation * @param url - The URL to the specification * @returns Formatted MDX string for the specification link */ export declare const formatMDXSpecifiedByLink: (url: string) => MDXString; /** * Formats a name entity with optional parent type * @param name - The name to format * @param parentType - Optional parent type to prefix the name * @returns Formatted MDX string for the name entity */ export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString; export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;