rst2html4(1)
π rst2html4 β the girlies' guide to reST β XHTML π
okay bestie, welcome to rst2html4, a manual page from section 1 (text processing) π she's giving "I turn your reStructuredText into XHTML" and honestly? she ate. β¨
πΈ NAME πΈ
rst2html4 β convert reST documents to XHTML π¦
no cap, that's the whole job. she takes your reST and hands you back some fresh XHTML.
β¨ SYNOPSIS β¨
rst2html4 [options] [<source> [<destination>]]
so you got your options, and then optionally a source and a destination, in that order. the square brackets mean they're optional, she's flexible like that π
π DESCRIPTION π
so here's the vibe: rst2html4 generates XHTML 1.1 documents from standalone reStructuredText sources π
the reST spec she's working off lives at <https://docutils.sourceforge.io/docs/user/html.html#html4css1> β go read it, it's iconic.
she reads from source β and if you don't hand her one, the default is stdin π β and she writes to destination, where the default is stdout β. so like, she can just vibe in a pipe if you want. no files required, she's low maintenance.
and if you want the full settings reference (like, the deep lore of every config option), it's right here:
<https://docutils.sourceforge.io/docs/user/config.html>
fr fr, bookmark that one. π«Ά
...more coming in part 2, don't go anywhere bestie π
β¨ OPTIONS β¨
okay bestie this is the main event, the options list, the whole fitting room π every flag rst2html4 will accept, grouped by which part of the machinery it belongs to. scroll, screenshot, live your truth.
π«Ά General Docutils Options π«Ά
these are the ones that talk to Docutils itself, the whole ecosystem, not just the HTML bit. literally the foundation, the base layer, the primer π
--output-path=<destination>,--output=<destination>β where the output actually goes, the destination name. heads up: this makes the old<destination>positional argument obsolete (rip bozo). Default:None, which means stdout, so it just spills out into your terminal.--title=<title>β set the document title as metadata. metadata only, it's not doing a whole rebrand for you.--generator,-gβ adds a "Generated by Docutils" credit and link. give the tool its flowers π--no-generatorβ no generator credit. no credit, no notes, we move in silence.--date,-dβ slaps the date at the end of the document, in UTC.--time,-tβ the time and the date, both, in UTC. main character timestamps β¨--no-datestampβ no datestamp of any kind. at all. zero. none.--root-prefix=<path>β the base directory used for absolute paths when it's reading from the local filesystem. Default:"".--source-link,-sβ include a "View document source" link.--source-url=<URL>β use<URL>for that source link. sneaky detail: this one implies--source-link, so you don't have to ask twice.--no-source-linkβ do not include a "View document source" link. hiding the receipts i see π--toc-entry-backlinksβ links from section headers back to the TOC entries. this is the (default) behavior, so you're already living it.--toc-top-backlinksβ links from section headers to the very top of the TOC instead of the entry itself.--no-toc-backlinksβ backlinks to the table of contents? disabled. gone.--footnote-backlinksβ links from footnotes/citations back to their references. (default) π--no-footnote-backlinksβ no backlinks from footnotes and citations. they can't find their way home.--section-numberingβ section numbering by Docutils, turned on. this is the (default).--no-section-numberingβ section numbering by Docutils, turned off. no numbers, just vibes.--strip-commentsβ removes comment elements from the document tree.--leave-commentsβ leaves comment elements in the document tree. (default).--strip-elements-with-class=<class>β nukes every element withclasses="<class>"from the document tree. β οΈ Warning: potentially dangerous; use with caution. Also: Multiple-use option, so you can stack it.--strip-class=<class>β removes allclasses="<class>"attributes from elements in the document tree (the elements stay, the class tag dips). β οΈ Warning: potentially dangerous; use with caution. Also a Multiple-use option.--report=<level>,-r <level>β report system messages at or above<level>. your levels are:infoor1,warning/2(default),error/3,severe/4,none/5.--verbose,-vβ report all system messages. same thing as--report=1, just shorter to type.--quiet,-qβ report no system messages. same thing as--report=5. shhh π€«--halt=<level>β halt execution when system messages hit at or above<level>. levels work like--report. Default:4(severe).--strictβ halts at the slightest problem, no chill whatsoever. same as--halt=info.--exit-status=<level>β makes it exit with a non-zero status for non-halting system messages at or above<level>. Default:5(which means disabled).--debugβ enables debug-level system messages and diagnostics. the flashlight π¦--no-debugβ disables debug output. (default).--warnings=<file>β sends the output of system messages into<file>.--tracebackβ enables Python tracebacks when Docutils gets halted. buckle up π’--no-tracebackβ disables Python tracebacks. (default).--input-encoding=<name[:handler]>β specify the encoding of input text, and optionally the error handler too. Default:utf-8.--output-encoding=<name[:handler]>β specify the text encoding for output and optionally the error handler. Default:utf-8.--error-encoding=<name[:handler]>,-e <name[:handler]>β specify text encoding and optionally the error handler for error output. Default: the system encoding.--language=<tag>,-l <tag>β specify the language as a BCP 47 language tag. Default:en.--record-dependencies=<file>β writes output file dependencies into<file>.--config=<file>β read configuration settings from<file>, if it exists. no file, no drama.--version,-Vβ shows this program's version number, then exits.--help,-hβ shows this help message, then exits. hi, hello, welcome π
π Generic Parser Options π
the parser's own little ruleset, shared across the parser family. very "we all agreed on this" energy.
--no-file-insertionβ disables directives that insert the contents of an external file. instead of doing the thing, it swaps in a "warning" system message.--file-insertion-enabledβ enables directives that insert the contents of an external file. (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 maximum number of characters in one input line. Default10 000.--legacy-idsβ keeps identifiers backwards compatible. this one is the Default.--matching-idsβ explicit targets use identifiers matching the reference name.--validateβ validates the document tree after parsing. check your work bestie β¨--no-validationβ does not validate the document tree. (default).
π¦ reStructuredText Parser Options π¦
this is the reStructuredText-specific section, and honestly it's giving extremely online with the PEP and RFC link recognition. iconic.
--pep-referencesβ recognizes standalone PEP references (like"PEP 258") and links them.--pep-base-url=<URL>β the base URL for PEP references. Default is"https://peps.python.org/".--pep-file-url-template=<URL>β template for the PEP file part of the URL. Default"pep-%04d".--rfc-referencesβ recognizes standalone RFC references (like"RFC 822") and links them.--rfc-base-url=<URL>β 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β removes the spaces before footnote references. tidy π--leave-footnote-reference-spaceβ leaves the spaces before footnote references alone.--syntax-highlight=<format>β the token name set used for parsing code with Pygments. one of"long","short", or"none"(which means 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,...]>β the characters to use as "smart quotes" for a given<language>.--word-level-inline-markupβ inline markup only gets recognized at word boundaries, meaning adjacent to punctuation or whitespace. if you really want character-level recognition, force it with""(that's backslash + space). this is the Default.--character-level-inline-markupβ inline markup gets recognized anywhere, no matter what's surrounding it. so you have to use backslash-escapes to avoid unwanted markup recognition. useful for East Asian languages. labeled Experimental, so, you know, proceed with intention. π§ͺ
π Standalone Reader Options π
the reader that reads your document all by itself. it has opinions about titles.
--no-doc-titleβ disables promoting a lone top-level section title into the document title. (which also kills the follow-up move: promoting the subsequent section title into the document subtitle, which is enabled by default.)--no-doc-infoβ disables the bibliographic field list transform. (that one's enabled by default.)--section-subtitlesβ activates promoting lone subsection titles into section subtitles. (disabled by default.)--no-section-subtitlesβ deactivates promoting lone subsection titles. that's it. that's the whole job.
π HTML Writer Options π
where the HTML actually gets its look. styling, structure, the outfit π
--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. this overrides any previous--stylesheetand--stylesheet-pathsettings, so it wins, periodt.--stylesheet-path=<file[,file,...]>β comma separated list of stylesheet paths. relative paths get expanded if a matching file turns up in the--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 accessible while it's processing. (default).--link-stylesheetβ links to the stylesheet(s) in the output HTML file instead.--initial-header-level=<level>β sets the initial header level. note it does not touch the document title & subtitle (go look at--no-doc-titlefor that). Default:1for"<h1>".--footnote-references=<format>β format for footnote references, one of"superscript"or"brackets". Default:"brackets".--attribution=<format>β format for block quote attributions: one of"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 compact simple bullet and enumerated lists. let them breathe.--compact-field-listsβ removes 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)]>β math output format (one of"MathML","HTML","MathJax", or"LaTeX") plus option(s). Default:"HTML math.css".--xml-declarationβ prepends an XML declaration. (default).--no-xml-declarationβ omits the XML declaration.--cloak-email-addressesβ obfuscates email addresses to confuse harvesters, while still keeping email links usable in standards-compliant browsers. sneaky and thoughtful at the same time π§
π HTML4 Writer Options π
last stretch bestie, just the html4-specific width knobs.
--field-name-limit=<level>β the maximum width, in characters, for one-column field names. longer field names will span an entire row of the table used to render the field list. Default is14characters. use0for "no limit".--option-limit=<level>β the maximum width, in characters, for options in 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, you made it to the end π«Ά this was the rst2html4(1) manual from Docutils β the version and date live down in the source footer, so go check the page you pulled this from for the exact ones. now go convert something and slay πβ¨π
π¦ 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