md-attr
v0.3.3 markdown tag
md-attr
html markdown attribute parser in node.
Install
npm install md-attr
Usage
<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-attr
commands:
mdattr test/md.html -o ./test.html
param:
-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