docutils-ts
Version:
Port of the Python Docutils library to TypeScript
12 lines (11 loc) • 393 B
JavaScript
import Writer from '../writers/htmlBase.js';
async function htmlTranslate(document) {
const writer = new Writer({ logger: document.logger });
const output = await writer.write(document, ((r) => r)); // TODO : fixme?
if (typeof output === 'undefined') {
throw new Error('undefined output');
}
return output;
}
export { htmlTranslate };
export default htmlTranslate;