0.3.5 • Published 10 years ago
md-attr v0.3.5
md-attr
html markdown attribute parser in node.
Install
npm install md-attrUsage
<section data-markdown>
# this is a markdown
## subtitle
</section>you can also source from a .md file
<section data-markdown="./test.md">
</section>Sample
var md_attr = require('md-attr');
var mdattr_test = md_attr(path.join(__dirname, 'md.html'), function(html) {
fs.writeFileSync('./test_after.html', html)
});API
mdattr(html path, callback)
- html path: should be the absolute path to your html file.
- callback: callback function, will pass the html that have being convert.
mdattr.html(html, base directory, callback)
- html: raw html
- base directory: base directory of your html file.
- callback: callback function, will pass the html that have being convert.
Cli tool
Install npm package to global
sudo npm install -g md-attrcommands:
mdattr test/md.html -o ./test.htmlparam:
-o --output: output folder (defualt tooutput.html)
This will compile test/md.html with md-attr, and output a file called ./test.html.
License
MIT @chilijung