Home / Function/ rehypePrism() — astro Function Reference

rehypePrism() — astro Function Reference

Architecture documentation for the rehypePrism() function in rehype-prism.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  356cf588_23e3_24d9_e890_923ff42f1550["rehypePrism()"]
  da185abf_9199_136b_bcd0_fc95377bf70f["rehype-prism.ts"]
  356cf588_23e3_24d9_e890_923ff42f1550 -->|defined in| da185abf_9199_136b_bcd0_fc95377bf70f
  style 356cf588_23e3_24d9_e890_923ff42f1550 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/markdown/remark/src/rehype-prism.ts lines 6–20

export const rehypePrism: Plugin<[string[]?], Root> = (excludeLangs) => {
	return async (tree) => {
		await highlightCodeBlocks(
			tree,
			(code, language) => {
				let { html, classLanguage } = runHighlighterWithAstro(language, code);

				return Promise.resolve(
					`<pre class="${classLanguage}" data-language="${language}"><code class="${classLanguage}">${html}</code></pre>`,
				);
			},
			excludeLangs,
		);
	};
};

Domain

Subdomains

Frequently Asked Questions

What does rehypePrism() do?
rehypePrism() is a function in the astro codebase, defined in packages/markdown/remark/src/rehype-prism.ts.
Where is rehypePrism() defined?
rehypePrism() is defined in packages/markdown/remark/src/rehype-prism.ts at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free