Home / Function/ prism() — astro Function Reference

prism() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5c629298_6101_17f5_8d4e_1acc2bf3ffc6["prism()"]
  98b47c20_2c30_515b_e879_3710eeab2cf2["prism.ts"]
  5c629298_6101_17f5_8d4e_1acc2bf3ffc6 -->|defined in| 98b47c20_2c30_515b_e879_3710eeab2cf2
  style 5c629298_6101_17f5_8d4e_1acc2bf3ffc6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/markdoc/src/extensions/prism.ts lines 5–21

export default function prism(): AstroMarkdocConfig {
	return {
		nodes: {
			fence: {
				attributes: Markdoc.nodes.fence.attributes!,
				transform({ attributes: { language, content } }) {
					const { html, classLanguage } = runHighlighterWithAstro(language, content);

					// Use `unescapeHTML` to return `HTMLString` for Astro renderer to inline as HTML
					return unescapeHTML(
						`<pre class="${classLanguage}"><code class="${classLanguage}">${html}</code></pre>`,
					) as any;
				},
			},
		},
	};
}

Domain

Subdomains

Frequently Asked Questions

What does prism() do?
prism() is a function in the astro codebase, defined in packages/integrations/markdoc/src/extensions/prism.ts.
Where is prism() defined?
prism() is defined in packages/integrations/markdoc/src/extensions/prism.ts at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free