Created
June 24, 2018 19:23
-
-
Save rubys/a061064e0744a5792b3e8331b0dae37d to your computer and use it in GitHub Desktop.
Processing all runs out of heapspace using remark
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 strict'; | |
const fs = require('fs'); | |
const processIncludes = require('./preprocess'); | |
const unified = require('unified'); | |
const markdown = require('remark-parse'); | |
const remark2rehype = require('remark-rehype'); | |
const html = require('rehype-stringify'); | |
const inputFile = '../../doc/api/all.md'; | |
let input = fs.readFileSync(inputFile, 'utf8'); | |
console.log(input); | |
processIncludes(inputFile, input, (err, fulltext) => { | |
unified() | |
.use(markdown) | |
.use(remark2rehype) | |
.use(html) | |
.process(fulltext, (err, text) => {console.log(err || text)}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment