markdown-it-conref
v1.0.0
Published
Adds the ability to use DITA Content References —or conrefs— as a markdown-it plugin.
Downloads
10
Maintainers
Readme
markdown-it-conref
Adds the ability to use DITA Content References —or conrefs— as a markdown-it
plugin.
Install
$ npm install --save markdown-it-conref
Usage
Using variables from an object
var md = require('markdown-it');
var conref = require('markdown-it-conref');
var options = {
data: {
site: {
batman: 'Bruce Wayne'
}
}
};
md.use(conref, options);
console.log(md.render('hello {{site.batman}}'));
// Output
// '<p>hello Bruce Wayne</p>\n'
Using variables from a json
or yml
file
var md = require('markdown-it');
var conref = require('markdown-it-conref');
var options = {
file: __dirname + '/test/data.yml'
}
md.use(conref, options);
console.log(md.render('hello {{site.batman}}'));
// Output
// '<p>hello Bruce Wayne</p>\n'
yaml:
site:
batman: 'Bruce Wayne'
foo: 'Foo'
bar: 'Bar'
Demo
License
MIT