Last active
April 5, 2017 14:56
-
-
Save njdart/523e07734a4bff7e5983da0f77339084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use babel'; | |
import MarkdownParser from 'extensible-markdown'; | |
import fs from 'fs'; | |
import bunyan from 'bunyan'; | |
import Os from 'os'; | |
import Path from 'path'; | |
let logger = bunyan.createLogger({ | |
name: 'markings-extensible-markdown-parser', | |
streams: [ | |
{ | |
// type: 'rotating-file', | |
// count: 5, | |
// period: '1d', | |
level: 'warn', | |
path: Path.join(Os.tmpdir(), 'markings-parser.error.log') | |
// stream: process.stdout | |
} | |
] | |
}); | |
// const parser = MarkdownParser.constructFromTemplatePaths( | |
// '/home/nic/git/njdart/markings-template-example/', | |
// '/home/nic/git/njdart/markings-template-example/', | |
// // '/home/nic/markingsTemplates/', | |
// // '/home/nic/markingsTemplates/report/ISO9001/' | |
// | |
// {logger} | |
// ); | |
const parser = new MarkdownParser({logger}); | |
const md = fs.readFileSync('/home/nic/git/njdart/extensible-markdown/src/testing/syntax.text').toString(); | |
const html = parser.parseText(md); | |
fs.writeFileSync('/tmp/markings-markdown.html', html); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment