JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12830
  • Score
    100M100P100Q135989F
  • License MIT

Compile Markdown to man pages (roff) with remark

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 Build Status Coverage Status Chat

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-man

Usage

Command line

Example how remark-man looks on screen

Use remark-man together with remark-cli:

npm install --global remark-cli remark-man

Let’s say example.md looks as follows:

# ls(1) -- list directory contents

## SYNOPSIS

`ls` \[`-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1`\] \[_file_ _..._\]

Now, running remark example.md --use man --output yields a new file, example.1:

.TH "LS" "1" "February 2016" "" ""
.SH "NAME"
\fBls\fR - list directory contents
.SH "SYNOPSIS"
.P
\fBls\fR \[lB]\fB-ABCFGHLOPRSTUW\[at]abcdefghiklmnopqrstuwx1\fR\[rB] \[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.

API

Use remark-man together with remark:

npm install remark remark-man --save

remark.use(man[, options])

Compile markdown to a man page.

options
  • name (string, optional);
  • section (number or string, optional);
  • description (string, optional);
  • date (given to new Date(), optional);
  • version (string, optional);
  • manual (string, optional).

The 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.

License

MIT © Titus Wormer