Home / Function/ rehypeInjectHeadingsExport() — astro Function Reference

rehypeInjectHeadingsExport() — astro Function Reference

Architecture documentation for the rehypeInjectHeadingsExport() function in rehype-collect-headings.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  83757e6e_f616_d934_26d5_84bfd47979db["rehypeInjectHeadingsExport()"]
  3c9e5992_882f_d415_46c7_b62ff2add339["rehype-collect-headings.ts"]
  83757e6e_f616_d934_26d5_84bfd47979db -->|defined in| 3c9e5992_882f_d415_46c7_b62ff2add339
  style 83757e6e_f616_d934_26d5_84bfd47979db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/src/rehype-collect-headings.ts lines 4–11

export function rehypeInjectHeadingsExport() {
	return function (tree: any, file: VFile) {
		const headings = file.data.astro?.headings ?? [];
		tree.children.unshift(
			jsToTreeNode(`export function getHeadings() { return ${JSON.stringify(headings)} }`),
		);
	};
}

Domain

Subdomains

Frequently Asked Questions

What does rehypeInjectHeadingsExport() do?
rehypeInjectHeadingsExport() is a function in the astro codebase, defined in packages/integrations/mdx/src/rehype-collect-headings.ts.
Where is rehypeInjectHeadingsExport() defined?
rehypeInjectHeadingsExport() is defined in packages/integrations/mdx/src/rehype-collect-headings.ts at line 4.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free