markdown-decorator
A lightweight utility for inserting text into markdown files and templates.
Table of contents
1. Installation
$ npm install --save markdown-decorator
2. Usage
2.1. Pass a markdown string to its constructor
const MarkdownDecorator = const fs = const pkg = const decorator = fs
2.2. Insert your product's (semantic) version
## Version and CHANGELOG `markdown-decorator`'s latest version is<!-- semver --><!-- semverend -->.Please read the [CHANGELOG][changelog-url] for details.
// pkg.version === '1.1.0-alpha.1'decorator
Inserts the semver:
## Version and CHANGELOG `markdown-decorator`'s latest version is<!-- semver -->1.1.0-alpha.1<!-- semverend -->.Please read the [CHANGELOG][changelog-url] for details.
2.3. Generate a table of contents
Use toc
comment tags as delimiters:
## Table of contents<!-- toc --><!-- tocend -->
decorator
2.4. Method chaining
const md = decorator
2.5. Templates
<%= header %><%= body %>---<%= footer %>
Use the decorate
method with an object literal to insert values in your template:
const md = decorator
2.6. Insert a string between delimiters
# `<!-- title --><!-- titleend -->`
decoratordecoratormarkdown// => # `<!-- title -->markdown-decorator<!-- titleend -->`
3. Version and CHANGELOG
markdown-decorator
is at v1.0.0
. Please see the CHANGELOG for details.
4. Contributing
We welcome contributors and pull requests. Check out the guidelines for
Contributions are stories with a beginning, a middle, and an end, all told through issues, comments, commit logs, and pull requests.