Home / Function/ createContentComponent() — astro Function Reference

createContentComponent() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  27a526d2_9eb5_700e_cf7c_1003e4c65079["createContentComponent()"]
  df14bb08_8e2c_26c3_53bb_884062fbbac0["runtime.ts"]
  27a526d2_9eb5_700e_cf7c_1003e4c65079 -->|defined in| df14bb08_8e2c_26c3_53bb_884062fbbac0
  0aac17a3_0011_c6f9_1ce3_cff5b2ae00ef["mergeConfig()"]
  27a526d2_9eb5_700e_cf7c_1003e4c65079 -->|calls| 0aac17a3_0011_c6f9_1ce3_cff5b2ae00ef
  911f75ce_1225_3f21_357b_d9e684166543["resolveComponentImports()"]
  27a526d2_9eb5_700e_cf7c_1003e4c65079 -->|calls| 911f75ce_1225_3f21_357b_d9e684166543
  a0f8bbb2_643b_d45a_a51e_dc308721f674["setupConfig()"]
  27a526d2_9eb5_700e_cf7c_1003e4c65079 -->|calls| a0f8bbb2_643b_d45a_a51e_dc308721f674
  style 27a526d2_9eb5_700e_cf7c_1003e4c65079 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/markdoc/src/runtime.ts lines 219–240

export function createContentComponent(
	Renderer: AstroInstance['default'],
	stringifiedAst: string,
	userConfig: AstroMarkdocConfig,
	options: MarkdocIntegrationOptions | undefined,
	tagComponentMap: Record<string, AstroInstance['default']>,
	nodeComponentMap: Record<NodeType, AstroInstance['default']>,
) {
	return createComponent({
		async factory(result: any, props: Record<string, any>) {
			const withVariables = mergeConfig(userConfig, { variables: props });
			const config = resolveComponentImports(
				await setupConfig(withVariables, options),
				tagComponentMap,
				nodeComponentMap,
			);

			return renderComponent(result, Renderer.name, Renderer, { stringifiedAst, config }, {});
		},
		propagation: 'self',
	} as any);
}

Domain

Subdomains

Frequently Asked Questions

What does createContentComponent() do?
createContentComponent() is a function in the astro codebase, defined in packages/integrations/markdoc/src/runtime.ts.
Where is createContentComponent() defined?
createContentComponent() is defined in packages/integrations/markdoc/src/runtime.ts at line 219.
What does createContentComponent() call?
createContentComponent() calls 3 function(s): mergeConfig, resolveComponentImports, setupConfig.

Analyze Your Own Codebase

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

Try Supermodel Free