readme-to-man-page
v0.6.0
Published
Convert package readme to a man page
Downloads
39
Maintainers
Readme
readme-to-man-page
Turn Markdown README into a good-looking man page.
Bells and whistles on top of the excellent remark-man by @wooorm.
Example
var readme = fs.readFileSync('./README.md', 'utf8');
var pkg = require('./package');
readmeToManPage(readme, {
name: pkg.name,
version: pkg.version,
description: pkg.description,
section: 'npm',
manual: 'Node Package Manager'
})
//=> '.TH "README-TO-MAN-PAGE" "npm" "July 2015" "0.1.2" "Node Package Manager"\n.SH "NAME"\n\\f...'
API
readmeToManPage(readme, [opts])
Returns man page as a string.
readme
Type: String
Readme text in Markdown.
Options
No option is required. But the more options are set, the more pleasing the output will be.
name
— can be inferred from headings.version
description
date
— latest revision date, passed toDate
constructor.section
— section code (e.g.1
).manual
— full section name (e.g.Linux Programmer's Manual
).
Related
- remark-man — compile Markdown to man pages with remark.
- npm-man — open any package readme from npm as a man page.
- man-pager — display a man page in the terminal programmatically.
Install
npm install readme-to-man-page
License
MIT