Rendering

Choose a renderer for diagrams, documents, HTML, images, ebooks, and templates.

Use rendering functions to turn templates, components, HTML, and diagrams into files or strings. Choose a guide for the output you need.

GuideFunctionOutput
Rendering Textrender()Plain text string
Rendering MermaidrenderMermaid()Self-contained SVG
Rendering PDFrenderPdf()Paginated PDF
Rendering HTMLrenderHtml()Static HTML string
Rendering ImagesrenderImage()PNG or JPEG
Rendering EbooksrenderEbook()EPUB or AZW3
Resizing ImagesresizeImage()Resized or re-encoded image

For model-generated content, see Generating Text, Generating Images, Generating Speech, and Generating Video.

Host Requirements

Installing Kaya does not install or configure every renderer. Provider operations need a configured host binding, storage, and a session grant. Each guide describes its requirements; see Tool Server and Runtime Settings for configuration by host.

RendererHost requirements
TemplatesNative Kaya template evaluation
HTMLOptional Node runtime with tsx, react, and react-dom
PDFChromium and the native Paged.js provider
MermaidChromium and the native document provider's pinned Mermaid bundle
ImagesChromium and an admitted browser-render binding
EbooksCalibre's ebook-convert executable and an ebook provider
Image resizingNative image-transform provider and artifact storage

Additional rendering and output tools are documented in the Standard Library:

  • typst() — typeset documents and images. Local rendering needs a Typst executable.
  • pdfToImage() — preview PDF pages as a PNG. The host needs Poppler's pdftoppm.
  • Chat.current.export() — combine retained chat audio into an MP3. The host needs an audio-export binding backed by FFmpeg.
  • measureHtmlPageFill() — estimate printed page count through a configured browser-render binding.

Function Guides

The detailed function documentation now has individual pages: