docstudio

The package root: everything from core and render, plus renderDocument. API reference in the DocStudio developer reference.

The package root re-exports everything from docstudio/core and docstudio/render, and adds one helper that uses both.

import { renderDocument } from 'docstudio';

One call

renderDocument(template, data, options?) compiles a template with data and renders it. It returns { ok, html, diagnostics }. ok is false when the template cannot be compiled or a diagnostic is an error, and html is empty when nothing could be rendered. The default target is print. Pass compile in the options to supply a registry, formatters, components or limits.

Use render from docstudio/render when you already have a resolved tree. See Built-in actions for the browser workflow with printHtml.

Reference

The sections below are generated from the exported source.