Package Exports
- remark-man
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-man) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
remark-man

Compile markdown to man pages with remark. Great unicode support; name, section, and description detection; nested block quotes and lists; tables; and much more.
Installation
npm:
npm install remark-manUsage
Say we have the following file, example.md:
# ls(1) -- list directory contents
## SYNOPSIS
`ls` [`-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1`] \[_file_ _..._]And our script, example.js, looks as follows:
var vfile = require('to-vfile');
var unified = require('unified');
var markdown = require('remark-parse');
var man = require('remark-man');
unified()
.use(markdown)
.use(man)
.process(vfile.readSync('example.md'), function (err, file) {
if (err) throw err;
file.extname = '.1';
vfile.writeSync(file);
});Now, running node example and cat example.1 yields:
.TH "LS" "1" "June 2015" "" ""
.SH "NAME"
\fBls\fR - list directory contents
.SH "SYNOPSIS"
.P
\fBls\fR \fB\fB-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1\fR\fR \[lB]\fIfile\fR \fI...\fR\[rB]Now, that looks horrible, but that’s how roff/groff/troff are 😉.
To properly view that man page, use something like this: man ./example.1.
remark.use(man[, options])
Compile markdown to a man page.
options
name(string, optional)section(numberorstring, optional)description(string, optional)date(given tonew Date(), optional)version(string, optional)manual(string, optional)
name and section can also be inferred from the file’s name:
hello-world.1.md will set name to 'hello-world' and section to '1'.
In addition, you can also provide inline configuration with a main heading. The following file:
# hello-world(7) -- Two common words...will set name to 'hello-world', section to '7', and description to
'Two common words'.
The main heading has precedence over the file name, and the file name over the plugin settings.
Related
remark-react— Compile to Reactremark-vdom— Compile to VDOMremark-html— Compile to HTMLremark-rehype— Properly transform to HTML
Contribute
See contribute.md in remarkjs/remarkj for ways to get started.
This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.