- 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>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
'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 };
|
||||
Reference in New Issue
Block a user