Home / Function/ getSlug() — astro Function Reference

getSlug() — astro Function Reference

Architecture documentation for the getSlug() function in heading-ids.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6de01015_c794_57fb_07f7_e76abc339720["getSlug()"]
  d811757b_f0ec_7a3f_0ab1_72f873fa4618["heading-ids.ts"]
  6de01015_c794_57fb_07f7_e76abc339720 -->|defined in| d811757b_f0ec_7a3f_0ab1_72f873fa4618
  e4e19689_8b6e_a761_609c_9df4ca836232["heading.transform()"]
  e4e19689_8b6e_a761_609c_9df4ca836232 -->|calls| 6de01015_c794_57fb_07f7_e76abc339720
  style 6de01015_c794_57fb_07f7_e76abc339720 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/markdoc/src/heading-ids.ts lines 10–20

function getSlug(
	attributes: Record<string, any>,
	children: RenderableTreeNode[],
	headingSlugger: Slugger,
): string {
	if (attributes.id && typeof attributes.id === 'string') {
		return attributes.id;
	}
	const textContent = attributes.content ?? getTextContent(children);
	return headingSlugger.slug(textContent);
}

Domain

Subdomains

Frequently Asked Questions

What does getSlug() do?
getSlug() is a function in the astro codebase, defined in packages/integrations/markdoc/src/heading-ids.ts.
Where is getSlug() defined?
getSlug() is defined in packages/integrations/markdoc/src/heading-ids.ts at line 10.
What calls getSlug()?
getSlug() is called by 1 function(s): heading.transform.

Analyze Your Own Codebase

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

Try Supermodel Free