Skip to main content

python-based cli to convert markdown to the roff (man-pages) format

Project description

roff

python-based cli to convert markdown to the roff (man-pages) format

roff-manpage head

Installation

PyPI - Version

pip install roff
pip install roff[front-matter]  # support for front-matter to configure roff
pip install roff[images]  # support for images
pip install roff[images-svg]  # support for svg-images
pip install roff[watch]  # support for rendering and auto-reloading a manpage while writing

[!TIP] After the installation you should be able to see roff's manpage with man roff or the file format information with man roff.5.

Usage/Execution

For the common usage you can create a template markdown file with the roff template subcommand and then convert it to the roff-file-format with roff convert

roff --help
roff template command.1.md
roff convert command.1.md
man ./command.1

Additionally, if roff[watch] was installed, you can run roff watch to see the rendered file that automatically re-renders if the file-content changes.

# shell 1
$ roff watch command.1.md
# shell 2
$ nano command.1.md
$ vim command.1.md

Additionally, if your project uses python argparse.ArgumentParser then you can start quicker by using the roff from-parser command instead of roff template. This works almost like the template command. But fills most of the fields.

$ roff from-parser --root src/ --output prog.1.md myprog.__main__:parser

File Format

roff uses markdown as the file format. It supports all commonmark markdown features (h1 is reserved for the head).

Additionally, roff brings 1 own markdown-feature, the inline-command! By prepending your inline-code with a $ sign it gets recognised as an inline-command and rendered in a more special way.

$`command subcommand [--arg value] file...`

example: inline-command

[!TIP] Use roff template command.1.md to get a pre-filled markdown file as a starting point.

Configuration

Example

The following image shows the manpage of roff itself.

(The manpage-content is slightly outdated but still shows what roff can do)

example: manpage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roff-0.7.0.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roff-0.7.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file roff-0.7.0.tar.gz.

File metadata

  • Download URL: roff-0.7.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for roff-0.7.0.tar.gz
Algorithm Hash digest
SHA256 1a6cdd75183abdc798a84a8867651ef651f2f232d678fe848501f928e847b320
MD5 ac210caad40b12f6d912bdaeaf209195
BLAKE2b-256 e74e019d1b434b7db5a90de5f406ced9faa63b258bf49c90487f48d1c5cdb60c

See more details on using hashes here.

File details

Details for the file roff-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: roff-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for roff-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c283249af221249c3e335b1682b4e2c9a65c0e1aa8cb82349c908cd6f227d58f
MD5 616f3fb93a0dc0a574fb1e109c3663eb
BLAKE2b-256 52e32a8a4a727a41aba70d2f888e09ae4944abd5ab077816f53630feeab0ad3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page