Every built-in extension is available through a separate package entry.
Import from @tanstack/markdown/extensions/callouts.
function calloutsExtension(): MarkdownExtensionCreates the block parser for GitHub-style > [!KIND] Optional title callouts.
function parseCalloutBlock(
context: BlockParseContext,
): CalloutNode | undefinedLow-level parser used by calloutsExtension.
Import from @tanstack/markdown/extensions/comment-components.
Provides an optional transformComponent(node) callback that receives each parsed ComponentNode.
Parsed comment data with block, lowercase name, and string attributes.
function commentComponentsExtension(
options?: CommentComponentOptions,
): MarkdownExtensionParses single <!-- ::name --> comments and paired <!-- ::start:name --> / <!-- ::end:name --> blocks.
Parses a component at the current block context and optionally transforms it.
function parseComponentComment(
line: string,
): ComponentComment | undefinedParses one component start or single-component comment.
function parseAttributes(value: string): Record<string, string>Parses quoted, unquoted, and boolean-style attributes. A valueless attribute becomes the string "true".
Import from @tanstack/markdown/extensions/docs.
Contains collectHeadings?: boolean | HeadingCollectionOptions.
function docsMarkdownExtensions(
options?: DocsMarkdownOptions,
): MarkdownExtension[]Returns callouts, transformed comment components, and heading collection unless collection is disabled.
Routes tabs and framework component nodes to their built-in transforms and returns other nodes unchanged.
Import from @tanstack/markdown/extensions/framework.
function transformFrameworkComponent(
node: ComponentNode,
): ComponentNodeSplits level-one framework sections into md-framework-panel children, records available-framework and code-block metadata, and labels nested headings by framework.
Import from @tanstack/markdown/extensions/headings.
Contains skipComponentNames?: ReadonlySet<string> | string[]. The default skips headings inside tabs components.
function headingCollectionExtension(
options?: HeadingCollectionOptions,
): MarkdownExtensionCreates a document transform that writes collected headings to document.headings.
function collectMarkdownHeadings(
document: MarkdownDocument,
options?: HeadingCollectionOptions,
): MarkdownHeading[]Collects headings recursively through lists, blockquotes, callouts, and components while respecting skipped component names and framework labels.
Import from @tanstack/markdown/extensions/tabs.
Dispatches by the component’s variant attribute. Unknown or missing variants use heading-based tabs.
Turns code-block children into md-tab-panel elements and records file names, languages, and code in data properties.
Parses framework: package... lines and records package groups plus install, dev-install, or local-install mode.
Selects Vite and Rsbuild heading sections and converts them to panels.
Splits content at the shallowest heading depth, creates stable tab slugs, and emits one panel per section.
The transforms return the original node when their expected input structure is absent.