rst2html(1)
π rst2html(1) π
bestie, you just opened the manual page for rst2html(1), and it lives in the text processing corner of the man-page universe. It's giving glow-up for your plain text files, no cap. π¦
β¨ NAME β¨
rst2html β convert reST documents to XHTML π
Like, the whole entire job in one line: reST goes in, XHTML comes out. That's it. That's the gig. π
β¨ SYNOPSIS β¨
rst2html [options] [<source> [<destination>]]
okay so look at that. [options] are optional (iconic behaviour), [<source>] is optional, [<destination>] is optional, and if you pass nothing at all it still runs because life finds a way. π
β¨ DESCRIPTION β¨
It generates HTML documents from standalone reStructuredText sources β the docs live at https://docutils.sourceforge.io/docs/user/html.html#html if you wanna go read the whole lore. πβ¨
It reads from source, and if you don't hand it a source, the default is stdin (so it'll just sip whatever you pipe into it, lowkey thirsty behaviour π₯€). It writes to destination, and if you don't give it a destination, the default is stdout β meaning it'll just spill the HTML right into your terminal, main character energy, no filter. π
Want the full settings reference, like every knob and dial and vibe? It's at https://docutils.sourceforge.io/docs/user/config.html. Go there. It's a whole thing. π«Ά
β¨ OPTIONS β¨
okay bestie this is the β¨big oneβ¨, every single flag rst2html will accept. no skimming, we're going through all of them π
π General Docutils Options π
--output-path=<destination>,--output=<destination>β where the output goes. this one makes the old<destination>positional argument obsolete, so don't @ it. Default:None(that means stdout, i.e. it just yells into your terminal π£οΈ).--title=<title>β set the document title as metadata.--generator,-gβ drop a "Generated by Docutils" credit in there, with a link and everything. iconic behavior.--no-generatorβ no generator credit. we keep it mysterious π«₯--date,-dβ slap the date at the end of the document (in UTC).--time,-tβ the time & date, both, UTC. so extra of it.--no-datestampβ no datestamp of any kind. not one. zero. π--root-prefix=<path>β the base directory for absolute paths when it's reading from your local filesystem. Default:"".--source-link,-sβ include a "View document source" link.--source-url=<URL>β use<URL>for the source link; heads up, this implies--source-link.--no-source-linkβ no "View document source" link, sorry gorgeous π--toc-entry-backlinksβ link from section headers back to TOC entries. (this is the default β¨)--toc-top-backlinksβ link from section headers to the top of the TOC instead.--no-toc-backlinksβ kill the backlinks to the table of contents entirely.--footnote-backlinksβ link from footnotes/citations back to their 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.--strip-commentsβ yank the comment elements out of the document tree.--leave-commentsβ leave comment elements right where they are. (default)--strip-elements-with-class=<class>β removes every element withclasses="<class>"from the document tree. > Warning: potentially dangerous; use with caution. (Multiple-use option β yes you can stack it, but careful bestie.)--strip-class=<class>β removes allclasses="<class>"attributes from elements in the document tree. > Warning: potentially dangerous; use with caution. (Multiple-use option.)--report=<level>,-r <level>β report system messages at or above<level>. your choices:"info"or"1","warning"/"2"(default),"error"/"3","severe"/"4","none"/"5".--verbose,-vβ report all the system messages. (Same as"--report=1".)--quiet, -q β report no system messages. silence, but make it glamorous. (Same as"--report=5".)--halt=<level>β halt execution at system messages at or above<level>. levels work the same as--report. Default:4(severe).--strictβ halt at the slightest problem, we are not playing. Same as"--halt=info".--exit-status=<level>β enables a non-zero exit status for non-halting system messages at or above<level>. Default:5(disabled).--debugβ enable debug-level system messages and diagnostics.--no-debugβ debug output off. (default)--warnings=<file>β send the output of system messages to<file>.--tracebackβ enable Python tracebacks when Docutils gets halted.--no-tracebackβ Python tracebacks off. (default)--input-encoding=<name[:handler]>β specify the encoding, and optionally the error handler, of the input text. Default:utf-8.--output-encoding=<name[:handler]>β same deal but for the output text encoding (and optionally its error handler). Default:utf-8.--error-encoding=<name[:handler]>,-e <name[:handler]>β the text encoding and optionally the error handler for error output. Default: system encoding.--language=<tag>,-l <tag>β specify the language as a BCP 47 language tag. Default:en.--record-dependencies=<file>β write the output file dependencies to<file>.--config=<file>β read configuration settings from<file>, if it exists.--version,-Vβ show this program's version number and dip. βοΈ--help,-hβ show this help message and dip.
π¦ 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 file-inserting directives. (default)--no-rawβ disables the"raw"directive; gets replaced with a"warning"system message.--raw-enabledβ enables the"raw"directive. (default)--line-length-limit=<length>β the maximal number of characters in one input line. Default10 000.--legacy-idsβ keeps identifiers backwards compatible. Default.--matching-idsβ explicit targets use identifiers that match the reference name.--validateβ validate the document tree after parsing.--no-validationβ don't validate the document tree. (default)
π reStructuredText Parser Options π
--pep-referencesβ recognize and link to standalone PEP references (like"PEP 258").--pep-base-url=<URL>β the base URL for PEP references (default"https://peps.python.org/").--pep-file-url-template=<URL>β the template for the PEP file part of the URL. (default"pep-%04d")--rfc-referencesβ recognize and link to standalone RFC references (like"RFC 822").--rfc-base-url=<URL>β the base URL for RFC references (default"https://tools.ietf.org/html/").--tab-width=<width>β how many spaces a tab expands to (default8).--trim-footnote-reference-spaceβ remove the spaces before footnote references.--leave-footnote-reference-spaceβ leave those spaces alone.--syntax-highlight=<format>β the token name set used for parsing code with Pygments. pick one of"long","short", or"none"(no parsing at all). Default is"long".--smart-quotes=<yes/no/alt>β turns straight quotation marks into typographic form β¨ one of"yes","no","alt[ernative]"(default"no").--smartquotes-locales=<language:quotes[,language:quotes,...]>β which characters count as "smart quotes" for a given<language>.--word-level-inline-markupβ inline markup is only recognized at word boundaries (right next to punctuation or whitespace). force character-level inline markup recognition with""(backslash + space). this is the Default.--character-level-inline-markupβ inline markup gets recognized anywhere, no matter what's around it. you must use backslash-escapes to stop markup from being recognized where you don't want it. useful for East Asian languages. Experimental, so bestie, tread carefully π
π Standalone Reader Options π
--no-doc-titleβ disables the promotion of a lone top-level section title to document title (and the follow-up where the next section title becomes the document subtitle; this promotion is enabled by default).--no-doc-infoβ disables the bibliographic field list transform (which is enabled by default).--section-subtitlesβ activates promoting lone subsection titles to section subtitles (disabled by default).--no-section-subtitlesβ deactivates that lone-subsection-title promotion.
π HTML Writer Options π
--template=<file>β the template file. (UTF-8 encoded, default:"/usr/share/docutils/writers/html4css1/template.txt")--stylesheet=<URL[,URL,...]>β comma separated list of stylesheet URLs. overrides whatever--stylesheetand--stylesheet-pathsaid before.--stylesheet-path=<file[,file,...]>β comma separated list of stylesheet paths. relative paths get expanded if a matching file turns up in--stylesheet-dirs. with--link-stylesheet, the path gets rewritten relative to the output HTML file. (default:"html4css1.css")--stylesheet-dirs=<dir[,dir,...]>β comma-separated list of directories where stylesheets live. used by--stylesheet-pathwhen it's expanding relative path arguments. (default:".,/usr/share/docutils/writers/html4css1,/usr/share/docutils/writers/html5_polyglot")--embed-stylesheetβ embeds the stylesheet(s) right into the output HTML file. the stylesheet files have to be reachable during processing. (default)--link-stylesheetβ links to the stylesheet(s) in the output HTML file instead.--initial-header-level=<level>β sets the initial header level. does not affect the document title & subtitle (see--no-doc-title). (default:1for"<h1>")--footnote-references=<format>β the format for footnote references, either"superscript"or"brackets". (default:"brackets")--attribution=<format>β the format for block quote attributions:"dash"(em-dash prefix),"parentheses"/"parens", or"none". (default:"dash")--compact-listsβ removes the extra vertical whitespace between items of "simple" bullet lists and enumerated lists. (default)--no-compact-listsβ disables those compact simple bullet and enumerated lists.--compact-field-listsβ removes the extra vertical whitespace between items of simple field lists. (default)--no-compact-field-listsβ disables compact simple field lists.--table-style=<style>β the class value(s) assigned to all tables. defined styles:borderless,booktabs,align-left,align-center,align-right,colwidths-auto,colwidths-grid.--math-output=<format[option(s)]>β the math output format, one of"MathML","HTML","MathJax", or"LaTeX", plus its option(s). (default:"HTML math.css")--xml-declarationβ prepend an XML declaration (default).--no-xml-declarationβ omit the XML declaration.--cloak-email-addressesβ obfuscate email addresses so the harvesters get confused π₯³ while still keeping email links usable in standards-compliant browsers.
π HTML4 Writer Options π
--field-name-limit=<level>β sets the maximum width (in characters) for one-column field names. longer field names will span an entire row of the table used to render that field list. Default is14characters. use0for "no limit".--option-limit=<level>β sets the maximum width (in characters) for options inside option lists. longer options will span an entire row of the table used to render the option list. Default is14characters. use0for "no limit".
and that's the whole page bestie, you made it to the end ππ this one's footer is just rst2html(1) doing its little page-name thing down at the bottom β source docs, version and date and all β so go live your truth and render that HTML, no cap β¨π¦π
π¦ where this page comes from
- ubuntu stonking: docutils-common 0.23+dfsg-2 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms