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.
| Guide | Function | Output |
|---|---|---|
| Rendering Text | render() | Plain text string |
| Rendering Mermaid | renderMermaid() | Self-contained SVG |
| Rendering PDF | renderPdf() | Paginated PDF |
| Rendering HTML | renderHtml() | Static HTML string |
| Rendering Images | renderImage() | PNG or JPEG |
| Rendering Ebooks | renderEbook() | EPUB or AZW3 |
| Resizing Images | resizeImage() | 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.
| Renderer | Host requirements |
|---|---|
| Templates | Native Kaya template evaluation |
| HTML | Optional Node runtime with tsx, react, and react-dom |
| Chromium and the native Paged.js provider | |
| Mermaid | Chromium and the native document provider's pinned Mermaid bundle |
| Images | Chromium and an admitted browser-render binding |
| Ebooks | Calibre's ebook-convert executable and an ebook provider |
| Image resizing | Native 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: