Last active
January 19, 2016 13:52
-
-
Save lionelB/90d46a47efe3ecec42bf to your computer and use it in GitHub Desktop.
markdown + gray-matter file transformation
This file contains hidden or 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
var markdownit = require("markdown-it")("commonmark"); | |
var yamlParser = require("gray-matter"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var content = fs.readFileSync(path.join(__dirname, "md/index.md")); | |
var yaml = yamlParser(content.toString()); | |
console.log(markdownit.render(yaml.content)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment