@avodado/render
v0.29.3
Published
Render Avodado documentation-as-code (Markdown + typed YAML blocks) to standalone, themeable HTML, slide decks, and PDF — architecture & system-design diagrams, C4, ERDs, API references, tables, and charts as self-contained SVG. No runtime, no CDN, no cli
Maintainers
Readme
@avodado/render
renderDocument(doc) → string. Pure function: takes a parsed @avodado/core Document, returns a standalone HTML string with inlined CSS and inline SVG diagrams. No browser, no DOM, no I/O.
Install
pnpm add @avodado/render @avodado/coreUsage
import { parseDocument } from '@avodado/core';
import { renderDocument } from '@avodado/render';
const html = renderDocument(parseDocument(markdown, 'orders'));Exports
renderDocument(doc)— full standalone HTML page (<!doctype html>…).houseCss— the house stylesheet as a string. Useful if you want to render into a fragment and inject CSS elsewhere.htmlRenderers—Record<BlockType, (data) => string>. Per-block renderer registry; typed so omitting a block type is a compile error.renderProse(text)— Markdown prose → HTML wrapped in.prose.escapeHtml(value)— entity-escape&<>".
Fidelity
CSS is ported verbatim from the reference renderer at resources/avodado-renderer.html. Block DOM signatures match the reference's class names and element structure. SVG geometry uses integer-only coordinates, so output is byte-deterministic.
