Files
autodoc/exporters/index.js
T
Iisyourdad a5bbdde480
Template tests / tests (push) Failing after 52s
Add binary exporters and template manager
- Native PDF exporter (cover, TOC, bookmarks, images, code, tables,
  text blocks); validated under Ghostscript
- Animated GIF exporter (title card, title overlay, progress bar)
- Image bundle exporter with watermark compositing
- DOCX and PPTX emitters (hand-built OOXML over our zip writer) with
  structural + relationship + XML well-formedness validation in tests
- Per-format template manager with .sfglt share archives
- Unified export dispatcher covering all nine formats
- 10 more workflow tests (52 total)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:59:19 -05:00

32 lines
999 B
JavaScript

'use strict';
const { exportJson } = require('./json');
const { exportMarkdown } = require('./markdown');
const { exportHtmlSimple, exportHtmlRich } = require('./html');
const { exportPdf } = require('./pdf');
const { exportGifGuide } = require('./gif');
const { exportImageBundle } = require('./image-bundle');
const { exportDocx } = require('./docx');
const { exportPptx } = require('./pptx');
/** Unified dispatch: format id -> exporter(ast, outDir, templateOptions). */
const EXPORTERS = {
json: exportJson,
markdown: exportMarkdown,
'html-simple': exportHtmlSimple,
'html-rich': exportHtmlRich,
pdf: exportPdf,
gif: exportGifGuide,
'image-bundle': exportImageBundle,
docx: exportDocx,
pptx: exportPptx,
};
function runExport(format, ast, outDir, templateOptions = {}) {
const exporter = EXPORTERS[format];
if (!exporter) throw new Error(`unknown export format: ${format}`);
return exporter(ast, outDir, templateOptions);
}
module.exports = { EXPORTERS, runExport };