1.0.0 • Published 8 years ago
md-sections v1.0.0
md-sections
Get an array of sections (heading + nodes) from a markdown doc, using remark
.
Any nodes before the first heading are ignored.
Usage
var sections = mdSections(root)
Args:
root
: rootremark
node
Output: Array of objects in the format { heading: node, nodes: <Array>node }
Example
var fs = require('fs')
var remark = require('remark')
var mdSections = require('md-sections')
var root = remark.parse(fs.readFileSync('./my-markdown-file.md'))
var sections = mdSections(root)
License
MIT
1.0.0
8 years ago