Home / Function/ renderToStaticMarkup() — astro Function Reference

renderToStaticMarkup() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  53783165_899a_054f_8624_2edd5bde81e3["renderToStaticMarkup()"]
  90e6a33a_3784_88f7_7685_7a18e74859af["server.ts"]
  53783165_899a_054f_8624_2edd5bde81e3 -->|defined in| 90e6a33a_3784_88f7_7685_7a18e74859af
  24b356be_bc1d_0fc2_c36f_ba2b6ccf6012["slotName()"]
  53783165_899a_054f_8624_2edd5bde81e3 -->|calls| 24b356be_bc1d_0fc2_c36f_ba2b6ccf6012
  9acfa750_02ca_2497_63b9_04250ba1be73["throwEnhancedErrorIfMdxComponent()"]
  53783165_899a_054f_8624_2edd5bde81e3 -->|calls| 9acfa750_02ca_2497_63b9_04250ba1be73
  style 53783165_899a_054f_8624_2edd5bde81e3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/src/server.ts lines 30–50

export async function renderToStaticMarkup(
	this: any,
	Component: any,
	props = {},
	{ default: children = null, ...slotted } = {},
) {
	const slots: Record<string, any> = {};
	for (const [key, value] of Object.entries(slotted)) {
		const name = slotName(key);
		slots[name] = value;
	}

	const { result } = this;
	try {
		const html = await renderJSX(result, jsx(Component, { ...props, ...slots, children }));
		return { html };
	} catch (e) {
		throwEnhancedErrorIfMdxComponent(e as Error, Component);
		throw e;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does renderToStaticMarkup() do?
renderToStaticMarkup() is a function in the astro codebase, defined in packages/integrations/mdx/src/server.ts.
Where is renderToStaticMarkup() defined?
renderToStaticMarkup() is defined in packages/integrations/mdx/src/server.ts at line 30.
What does renderToStaticMarkup() call?
renderToStaticMarkup() calls 2 function(s): slotName, throwEnhancedErrorIfMdxComponent.

Analyze Your Own Codebase

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

Try Supermodel Free