CM2MAN(1)
β¨ CM2MAN(1) β bestie edition β¨
okay so this is cm2man, and it ships with the recommonmark Python package π (Debian's 0.7.1+ds-5 build, February 2023, for the record π). Sit down, grab a strawberry π, and let's get you fluent.
π NAME π
cm2man β convert a CommonMark file into a man page. that's the whole job. she does one thing and she slays it π
πΈ SYNOPSIS πΈ
cm2man [options] [<source> [<destination>]]
π¦ DESCRIPTION π¦
So basically: you hand her markdown, she hands you back a manpage. iconic behaviour fr fr.
She reads from <source> β and if you don't give her one, she just reads from stdin like the low-maintenance queen she is. She writes to <destination>, and if you don't give her one of those either, it's stdout, no cap.
π‘ if you want the full settings reference β like, the deep lore β go look at https://docutils.sourceforge.io/docs/user/config.html. she is not gatekeeping, she is literally linking it.
π OPTIONS π
π General Docutils Options π
--title=TITLEβ sets the document title as metadata. name her, bestie.--generator,-gβ drops in a "Generated by Docutils" credit and a link, so everyone knows who did it.--no-generatorβ no generator credit. she's staying mysterious π--date,-dβ sticks the date at the end of the document (UTC).--time,-tβ sticks the time & date (UTC) on there. timestamp queen β°--no-datestampβ no datestamp of any kind. zero. none. gone.--source-link,-sβ adds a "View document source" link.--source-url=<URL>β use <URL> for that source link; heads up, this implies--source-linkautomatically.--no-source-linkβ no "View document source" link. she's not sharing her sources π--toc-entry-backlinksβ links from section headers back to TOC entries. (this is the default, so it's already the vibe β¨)--toc-top-backlinksβ links from section headers to the top of the TOC instead.--no-toc-backlinksβ kills backlinks to the table of contents entirely. brutal. periodt.--footnote-backlinksβ links from footnotes/citations to references. (default π«Ά)--no-footnote-backlinksβ no backlinks from footnotes and citations.--section-numberingβ turns on section numbering, done by Docutils. (default!)--no-section-numberingβ turns section numbering off. goodbye numbers π’--strip-commentsβ removes comment elements from the document tree.--leave-commentsβ leaves comment elements in the tree. (default πΈ)--strip-elements-with-class=<class>β nukes every element withclasses="<class>"from the document tree.
β οΈ warning: potentially dangerous; use with caution. and it's a multiple-use option, so you can stack it.
--strip-class=<class>β removes allclasses="<class>"attributes from elements in the document tree.
β οΈ warning: potentially dangerous; use with caution. also a multiple-use option.
--report=<level>,-r <level>β report system messages at or above <level>. your choices are:"info"or"1","warning"/"2"(default),"error"/"3","severe"/"4","none"/"5".--verbose,-vβ report all system messages. (same as"--report=1".) she's telling you everything, bestie π£οΈ--quiet,-qβ report no system messages. (same as"--report=5".) silence. zen. π§--halt=<level>β halt execution at system messages at or above <level>. levels work like in--report. default:4(severe).--strictβ halt at the slightest problem. same as"--halt=info". she is not playing around π€--exit-status=<level>β enables a non-zero exit status for non-halting system messages at or above <level>. default:5(which means disabled).--debugβ enables debug-level system messages and diagnostics. detective mode π--no-debugβ disables debug output. (default)--warnings=<file>β sends the output of system messages to <file>.--tracebackβ enables Python tracebacks when Docutils is halted.--no-tracebackβ disables Python tracebacks. (default)--input-encoding=<name[:handler]>,-i <name[:handler]>β specify the encoding and optionally the error handler for input text. default:<auto-detect>:strict.--input-encoding-error-handler=INPUT_ENCODING_ERROR_HANDLERβ the error handler for undecodable characters. choices:"strict"(default),"ignore", and"replace".--output-encoding=<name[:handler]>,-o <name[:handler]>β specify the text encoding and optionally the error handler for output. default:utf-8:strict.--output-encoding-error-handler=OUTPUT_ENCODING_ERROR_HANDLERβ error handler for unencodable output characters:"strict"(default),"ignore","replace","xmlcharrefreplace","backslashreplace".--error-encoding=<name[:handler]>,-e <name[:handler]>β specify text encoding and optionally an error handler for error output. default text encoding: system encoding. default error handler:backslashreplace.--error-encoding-error-handler=ERROR_ENCODING_ERROR_HANDLERβ the error handler for unencodable characters in error output. default:backslashreplace.--language=<name>,-l <name>β specify the language as a BCP 47 language tag. default:en.--record-dependencies=<file>β write output file dependencies to <file>.--config=<file>β read configuration settings from <file>, if it exists. (if it doesn't exist, no drama, she moves on π)--version,-Vβ show this program's version number and exit.--help,-hβ show this help message and exit. the classic π
π§ Generic Parser Options π§
--no-file-insertionβ disables directives that insert the contents of an external file; they get replaced with a"warning"system message.--file-insertion-enabledβ enables those external-file-inserting directives. (default β¨)--no-rawβ disables the"raw"directive; replaced with a"warning"system message.--raw-enabledβ enables the"raw"directive. (default)--line-length-limit=<length>β the maximal number of characters in an input line. default10 000. that's a lot of characters, bestie π
π Standalone Reader Options π
--no-doc-titleβ disables promotion of a lone top-level section title to document title (and the subsequent promotion of a section title to document subtitle β that one is enabled by default).--no-doc-infoβ disables the bibliographic field list transform (enabled by default).--section-subtitlesβ activates promotion of lone subsection titles to section subtitles (disabled by default).--no-section-subtitlesβ deactivates promotion of lone subsection titles.
π AUTHOR π
Steve Genoud and Luca Barbato β the duo behind all this. shoutout π«Ά
β COPYRIGHT β
Copyright (C) 2014 Steve Genoud and Luca Barbato
and that's the whole page, bestie π you are now officially fluent in cm2man. go make some manpages, main character energy only.
β written by the lovely people behind recommonmark, Debian build 0.7.1+ds-5, February 2023. thanks for coming to her TED talk ππ
π¦ where this page comes from
- debian bookworm: recommonmark-scripts 0.7.1+ds-5 Β· MIT
- ubuntu noble: recommonmark-scripts 0.7.1+ds-5 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms