Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

marked-man

kapouer66.3kMIT2.1.0

wrapper adding manpage output to 'marked', inspired by 'ronn'

markdown, roff, ronn

readme

marked-man(1) -- markdown to roff

SYNOPSIS

marked-man README.md > doc/foo.1
# works too with stdin
cat README.md | marked-man --version 1.0 | man /dev/stdin

See also marked documentation.

DESCRIPTION

marked-man wraps marked to extend it with groff output support in order to create Unix manual pages for use with man.

It follows the ronn markdown level-1 header format:

# name(section) -- short description

which populates the HEADER section, and the NAME section (if none is already written) of the manpage.

OPTIONS

marked-man is a marked CLI extension, meaning options can be passed directly to marked.

The --breaks option, which retains intra-paragraph line breaks, is now true by default. Use --no-breaks to disable it.

marked-man adds some options to marked's existing options, to be able to override the header/footer of generated man pages.

  • --name <name> Optional, overrides name in ronn header.

  • --section <section> Optional, overrides section in ronn header. Defaults to 1.

  • --description <description> Optional, overrides description in ronn header.

  • --version <version> The version shown in the manpage footer. Optional, when omitted, defaults to the target node module version, or empty.

  • --manual <manual> The manual-group name shown in the manpage header. Optional, when omitted, man displays a value matching the section.

  • --date <date> The date shown in the manpage header. Optional, defaults to now. Must be acceptable to new Date(string or timestamp). Honors SOURCE_DATE_EPOCH environment variable for reproducible builds.

INSTALLATION

See your node package manager manual...

For example:

npx marked-man simple.md

EXAMPLE

To view this README as a man page, run something like the following:

marked-man README.md | man /dev/stdin

AS MARKED EXTENSION

import markedMan from 'marked-man';
import marked from 'marked';

marked.use(markedMan);

SEE ALSO

Ronn Ronn-NG groff

REPORTING BUGS

See marked-man repository.

changelog

CHANGES

0.1.4

  • depends on marked 0.3.2
  • use .nf/.fi instead of .EX/.EE to format blockquotes

0.1.6

  • ensure tests pass

0.2.0

  • add support for gfm table

0.2.1

  • remove useless test files from npm package

0.3.0

  • accept a timestamp in milliseconds as --date argument

1.0.0

  • node >= 12
  • --format option is dropped, use directly marked for html output
  • other options should work the same
  • mostly rewritten
  • depends marked >= 4.2
  • more groff macros are implemented

1.1.0

  • --breaks is now the default

1.2.0

  • the level-2 NAME section is not generated if it already exists
  • --section, if missing from ronn header, is set to 1 by default
  • --manual, if missing, is now omitted to let man display a default value
  • --description can set the description if not set from ronn header format
  • --version, if missing, is read from package.json of target file module, or omitted.

1.3.0

  • fix crash when md has only one token
  • better support for stdin, e.g. cat file.md | marked-man | man /dev/stdin
  • fix blockquote, use a table