@apivexa/renderer
v0.1.4
Published
> Renders a Documentation IR to Markdown, HTML, PDF, or DOCX.
Downloads
942
Readme
@apivexa/renderer
Renders a Documentation IR to Markdown, HTML, PDF, or DOCX.
Part of ApiVexa — AI-powered API User Guide Generator.
Install
npm install @apivexa/rendererPDF rendering requires Playwright (
npm install playwright+npx playwright install chromium).
Usage
import {
renderToMarkdown,
renderToHtml,
renderToPdf,
renderToDocx,
} from '@apivexa/renderer';
// Markdown (synchronous)
const md = renderToMarkdown(documentIr);
// HTML (synchronous)
const html = renderToHtml(documentIr);
// PDF — returns a Buffer (requires Playwright)
const pdf = await renderToPdf(documentIr);
// DOCX — returns a Buffer
const docx = await renderToDocx(documentIr);All renderers accept a DocumentIr from @apivexa/documentation.
Output characteristics
| Format | Engine | Output |
|--------|--------|--------|
| Markdown | Built-in | .md string |
| HTML | Built-in | Self-contained .html with inline CSS |
| PDF | Playwright (headless Chromium) | Binary Buffer |
| DOCX | docx library | Binary Buffer |
