Skip to content

contentRenderer

contentRenderer(__namedParameters): Promise<string>

Content Renderer

Renders content based on the renderer configuration

Parameters

__namedParameters: ContentRenderer

Returns

Promise<string>

The rendered content

Example

function sampleRenderer(content: string): Promise<string> {
// Assuming the renderer function processes the content and returns a string
return `<p>${content}</p>`;
}
const renderedContent = contentRenderer({
content: 'Hello, world!',
renderer: sampleRenderer,
});

Defined in

packages/studiocms_renderers/src/lib/contentRenderer.ts:33