mdkit
v1.1.0
Published
Markdown documentation kit.
Downloads
8
Readme
mdkit
Markdown documentation kit.
Installation
npm install mdkit
markdown replacer
project/path/README.md
# Project Name ## License <!-- mdkit-replace-start: license --> <!-- mdkit-replace-end: license --> ## Prerequisites <!-- mdkit-replace-start: prerequisites --> <!-- mdkit-replace-end: prerequisites -->
Write scripts
const mdkit = require('mdkit'); mdkit .replacer('project/path/README.md') .replace('license', () => { // Replace content inside comments named 'license' with the package.json's license. return packageJSON.license; }) .replace('prerequisites', () => { // Replace content inside comments named 'prerequisites' with the package.json's peerDependencies. const {peerDependencies} = packageJSON // ... return prerequisites; }); .write(); // Write replaced result on `project/path/README.md`.
markdown builder
- Headings
mdkit.markdown()
.heading1("header")
.build(); // # Header1
mdkit.markdown().
heading3("header")
.build(); // ### Header3
- List
mdkit.markdown()
.listItem('item 1')
.listItem('item 2');;
.build();
// - item 1
// - item 2