Parser and converter for org-mode notation written in JavaScript.
For working example, see demo/editor
.
npm install -S org.js
const org = require("org");
const parser = new org.Parser();
const orgCode = '* A Big Title';
const orgDoc = parser.parse(orgCode);
const orgHTMLDoc = orgDoc.convert(org.Converter.html, {
headerOffset: 1,
exportFromLineNumber: false,
suppressSubScriptHandling: false,
suppressAutoLink: false
});
console.dir(orgHTMLDoc); // { title, contentHTML, tocHTML, toc }
console.log(orgHTMLDoc.toString()) // Rendered HTML
Read src/converter/html.js
.
- Original code is from mooz/org-js.
MIT