Last active
August 29, 2015 14:24
-
-
Save nikolaswise/8649ca27f40b22027c8b to your computer and use it in GitHub Desktop.
static-site markdown helper
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 md = require('markdown-it')({ | |
html: true, | |
linkify: true, | |
typographer: true, | |
quotes: '“”‘’' | |
}) | |
.use(require('markdown-it-highlightjs')) | |
.use(require('markdown-it-footnote')) | |
.use(require('markdown-it-emoji')) | |
.use(require('markdown-it-container'), 'figure') | |
var typogr = require('typogr'); | |
module.exports = function (site, cb) { | |
site = site.map(function (page) { | |
console.log(page.isMarkdown) | |
if (page.isMarkdown) { | |
page.content = md.render(page.content) | |
page.content = typogr.typogrify(page.content) | |
} | |
return page | |
}) | |
cb(null, site) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tons of markdown goodies like footnotes, tables, and custom div classes, emoji, and all the proper typography options you could ever need.