remark-title
v1.0.4
Published
remark plugin to inject a title into a file
Downloads
1,284
Maintainers
Readme
remark-title
remark plugin to check and inject the title of a markdown as the first element.
Usage
Used as a plugin for remark like so:
const title = require('remark-title')
const remark = require('remark')
readme = remark()
.use(title, {title: 'remark-title'})
.processSync(readme)
This will add a title to your document if one is not already present.
The title will be the name of the folder (VFile#dirname
,
when available, or process.cwd()
), unless specified as an option.
If an existing title is different (case-insensitive), it will replace it.
For example, the following input markdown:
# Bogus Title
Hello World!
Would yield:
# remark-title
Hello World!
options.title
Optional. A string for a specified title.
License
MIT. See LICENSE.md for details.