rst-buildhtml(1)

โœจ NAME โœจ

okay so bestie, meet rst-buildhtml(1) โ€” the absolute icon who turns a whole directory of reStructuredText files into HTML. no cap, she's giving batch-converter main character energy. ๐Ÿ’…


๐Ÿ“œ SYNOPSIS ๐Ÿ“œ

rst-buildhtml [options] [<directory> ...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Generate .html from all reStructuredText files in each <directory> (default is the current directory). So like, you just point her at some folders, and she goes through every reST file and pops out HTML. Lowkey magic, highkey useful. โœจ


๐Ÿ’– OPTIONS ๐Ÿ’–

okay so this is the big one. She has options on options. Let's vibe check them all, bestie. ๐ŸŽ€

๐ŸŒธ General Docutils Options ๐ŸŒธ

  • --output-path=<destination>, --output=<destination> โ€” Output destination name. Obsoletes the <destination> positional argument. Default: None (stdout). ๐Ÿ’…
  • --title=<title> โ€” Specify the document title as metadata. ๐Ÿ“
  • --generator, -g โ€” Include a "Generated by Docutils" credit and link. ๐ŸŽ€
  • --no-generator โ€” Do not include a generator credit. ๐Ÿšซ
  • --date, -d โ€” Include the date at the end of the document (UTC). ๐Ÿ“…
  • --time, -t โ€” Include the time & date (UTC). โฐ
  • --no-datestamp โ€” Do not include a datestamp of any kind. ๐Ÿ™ˆ
  • --root-prefix=<path> โ€” Base directory for absolute paths when reading from the local filesystem. Default "". ๐Ÿ“‚
  • --source-link, -s โ€” Include a "View document source" link. ๐Ÿ”—
  • --source-url=<URL> โ€” Use <URL> for a source link; implies --source-link. ๐ŸŒ
  • --no-source-link โ€” Do not include a "View document source" link. ๐Ÿšซ
  • --toc-entry-backlinks โ€” Link from section headers to TOC entries. (default) ๐Ÿ”™
  • --toc-top-backlinks โ€” Link from section headers to the top of the TOC. โฌ†๏ธ
  • --no-toc-backlinks โ€” Disable backlinks to the table of contents. โŒ
  • --footnote-backlinks โ€” Link from footnotes/citations to references. (default) ๐Ÿ”
  • --no-footnote-backlinks โ€” Disable backlinks from footnotes and citations. ๐Ÿšซ
  • --section-numbering โ€” Enable section numbering by Docutils. (default) ๐Ÿ”ข
  • --no-section-numbering โ€” Disable section numbering by Docutils. โŒ
  • --strip-comments โ€” Remove comment elements from the document tree. ๐Ÿงน
  • --leave-comments โ€” Leave comment elements in the document tree. (default) ๐Ÿ’ฌ
  • --strip-elements-with-class=<class> โ€” Remove all elements with classes="<class>" from the document tree. Warning: potentially dangerous; use with caution. (Multiple-use option.) โš ๏ธ
  • --strip-class=<class> โ€” Remove all classes="<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 higher than <level>: "info" or "1", "warning"/"2" (default), "error"/"3", "severe"/"4", "none"/"5". ๐Ÿ“ข
  • --verbose, -v โ€” Report all system messages. (Same as "--report=1".) ๐Ÿ—ฃ๏ธ
  • --quiet, -q โ€” Report no system messages. (Same as "--report=5".) ๐Ÿคซ
  • --halt=<level> โ€” Halt execution at system messages at or above <level>. Levels as in --report. Default: 4 (severe). ๐Ÿ›‘
  • --strict โ€” Halt at the slightest problem. Same as "--halt=info". ๐Ÿ˜ค
  • --exit-status=<level> โ€” Enable 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 โ€” Disable debug output. (default) ๐Ÿšซ
  • --warnings=<file> โ€” Send the output of system messages to <file>. ๐Ÿ“„
  • --traceback โ€” Enable Python tracebacks when Docutils is halted. ๐Ÿ
  • --no-traceback โ€” Disable Python tracebacks. (default) ๐Ÿšซ
  • --input-encoding=<name[:handler]> โ€” Specify the encoding and optionally the error handler of input text. Default: utf-8. ๐Ÿ“ฅ
  • --output-encoding=<name[:handler]> โ€” Specify the text encoding and optionally the error handler for output. Default: utf-8. ๐Ÿ“ค
  • --error-encoding=<name[:handler]>, -e <name[:handler]> โ€” Specify text encoding and optionally the error handler for error output. Default: system encoding. ๐Ÿšจ
  • --language=<tag>, -l <tag> โ€” Specify the language (as 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. โš™๏ธ
  • --version, -V โ€” Show this program's version number and exit. ๐Ÿ‘‹
  • --help, -h โ€” Show this help message and exit. ๐Ÿ†˜

๐ŸŒˆ PEP Reader Option Defaults ๐ŸŒˆ

The --pep-references and --rfc-references options (for the reStructuredText parser) are on by default. So like, they're already slaying. ๐Ÿ’…

๐Ÿฆ‹ Generic Parser Options ๐Ÿฆ‹

  • --no-file-insertion โ€” Disable directives that insert the contents of an external file; replaced with a "warning" system message. ๐Ÿšซ
  • --file-insertion-enabled โ€” Enable directives that insert the contents of an external file. (default) โœ…
  • --no-raw โ€” Disable the "raw" directive; replaced with a "warning" system message. ๐Ÿšซ
  • --raw-enabled โ€” Enable the "raw" directive. (default) โœ…
  • --line-length-limit=<length> โ€” Maximal number of characters in an input line. Default 10 000. ๐Ÿ“
  • --legacy-ids โ€” Keep identifiers backwards compatible. Default. ๐Ÿ‘ต
  • --matching-ids โ€” Explicit targets use identifiers matching the reference name. ๐ŸŽฏ
  • --validate โ€” Validate the document tree after parsing. โœ…
  • --no-validation โ€” Do not validate the document tree. (default) ๐Ÿšซ

โœจ reStructuredText Parser Options โœจ

  • --pep-references โ€” Recognize and link to standalone PEP references (like "PEP 258"). ๐Ÿ
  • --pep-base-url=<URL> โ€” Base URL for PEP references (default "<https://peps.python.org/>"). ๐Ÿ”—
  • --pep-file-url-template=<URL> โ€” Template for PEP file part of URL. (default "pep-%04d"). ๐Ÿ“„
  • --rfc-references โ€” Recognize and link to standalone RFC references (like "RFC 822"). ๐Ÿ“š
  • --rfc-base-url=<URL> โ€” Base URL for RFC references (default "<https://tools.ietf.org/html/>"). ๐Ÿ”—
  • --tab-width=<width> โ€” Set number of spaces for tab expansion (default 8). ๐Ÿ“
  • --trim-footnote-reference-space โ€” Remove spaces before footnote references. โœ‚๏ธ
  • --leave-footnote-reference-space โ€” Leave spaces before footnote references. ๐Ÿ’ฌ
  • --syntax-highlight=<format> โ€” Token name set for parsing code with Pygments: one of "long", "short", or "none" (no parsing). Default is "long". ๐ŸŽจ
  • --smart-quotes=<yes/no/alt> โ€” Change straight quotation marks to typographic form: one of "yes", "no", "alt[ernative]" (default "no"). ๐Ÿ’ฌ
  • --smartquotes-locales=<language:quotes[,language:quotes,...]> โ€” Characters to use as "smart quotes" for <language>. ๐ŸŒ
  • --word-level-inline-markup โ€” Inline markup recognized at word boundaries only (adjacent to punctuation or whitespace). Force character-level inline markup recognition with `"\ "` (backslash + space). Default. ๐Ÿ“
  • --character-level-inline-markup โ€” Inline markup recognized anywhere, regardless of surrounding characters. Backslash-escapes must be used to avoid unwanted markup recognition. Useful for East Asian languages. Experimental. ๐Ÿงช

๐ŸŽ€ HTML Writer Options ๐ŸŽ€

  • --template=<file> โ€” Template file. (UTF-8 encoded, default: "/usr/share/docutils/writers/html4css1/template.txt"). ๐Ÿ“„
  • --stylesheet=<URL[,URL,...]> โ€” Comma separated list of stylesheet URLs. Overrides previous --stylesheet and --stylesheet-path settings. ๐ŸŽจ
  • --stylesheet-path=<file[,file,...]> โ€” Comma separated list of stylesheet paths. Relative paths are expanded if a matching file is found in the --stylesheet-dirs. With --link-stylesheet, the path is rewritten relative to the output HTML file. (default: "html4css1.css"). ๐ŸŽจ
  • --stylesheet-dirs=<dir[,dir,...]> โ€” Comma-separated list of directories where stylesheets are found. Used by --stylesheet-path when expanding relative path arguments. (default: ".,/usr/share/docutils/writers/html4css1,/usr/share/docutils/writers/html5_polyglot"). ๐Ÿ“
  • --embed-stylesheet โ€” Embed the stylesheet(s) in the output HTML file. The stylesheet files must be accessible during processing. (default) ๐Ÿ’พ
  • --link-stylesheet โ€” Link to the stylesheet(s) in the output HTML file. ๐Ÿ”—
  • --initial-header-level=<level> โ€” Specify the initial header level. Does not affect document title & subtitle (see --no-doc-title). (default: 1 for "<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 โ€” Remove extra vertical whitespace between items of "simple" bullet lists and enumerated lists. (default) ๐Ÿ“
  • --no-compact-lists โ€” Disable compact simple bullet and enumerated lists. ๐Ÿšซ
  • --compact-field-lists โ€” Remove extra vertical whitespace between items of simple field lists. (default) ๐Ÿ“
  • --no-compact-field-lists โ€” Disable compact simple field lists. ๐Ÿšซ
  • --table-style=<style> โ€” 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") and 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 to confuse harvesters while still keeping email links usable with standards-compliant browsers. ๐Ÿ•ต๏ธ

๐Ÿ’œ HTML4 Writer Options ๐Ÿ’œ

  • --field-name-limit=<level> โ€” Specify 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 is 14 characters. Use 0 for "no limit". ๐Ÿ“
  • --option-limit=<level> โ€” Specify 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 is 14 characters. Use 0 for "no limit". ๐Ÿ“

๐Ÿ PEP/HTML Writer Options ๐Ÿ

For the PEP/HTML writer, the default value for the --stylesheet-path option is "/usr/share/docutils/writers/pep_html/pep.css", and the default value for --template is "/usr/share/docutils/writers/pep_html/template.txt". See HTML Writer Options above. ๐Ÿ‘€

  • --python-home=<URL> โ€” Python's home URL. Default is "<https://www.python.org>". ๐Ÿ
  • --pep-home=<URL> โ€” Home URL prefix for PEPs. Default is "." (current directory). ๐Ÿ 

โœจ Build-HTML Options โœจ

okay bestie, we're in the build-HTML zone now ๐ŸŽ€ these are the switches that control how rst-buildhtml finds your files, ignores your files, and spits out that sweet, sweet HTML. let's get into it ๐Ÿ’…

  • --sources=<patterns> โ€” this one is the "what files are we even looking at?" queen ๐Ÿ‘‘. It processes every file that matches any of the glob-style patterns you throw at it, and you separate multiple patterns with colons. Heads up: this option overwrites the default or config-file values. Default vibe: ".rst:.txt".
  • --ignore=<patterns> โ€” recursively ignore files that match any of the given glob-style patterns (separated by colons). You can use this more than once to add more patterns, so it's like a block list you keep adding to ๐Ÿšซ. no cap.
  • --local โ€” do not scan subdirectories for files to process. it's giving "stay in your lane, only this folder" ๐Ÿ’….
  • --recurse โ€” recursively scan subdirectories for files to process. This is the default! so it's already the main character energy โœจ.
  • --prune=<directory> โ€” do not process files in <directory> (glob-style patterns, separated by colons). This option may be used more than once to add more patterns. Default: "//.hg://.bzr://.git://.svn://.venv://__pycache__". (Yes bestie, that's a lot of slashes, but that's literally what it says ๐Ÿ’€.)
  • --writer=<writer> โ€” Docutils writer, one of "html", "html4", "html5". Default: "html" (use Docutils' default HTML writer). So you pick your HTML flavor: classic, older, or newer ๐Ÿ”ฅ.
  • --silent โ€” work silently (no progress messages). Independent of "--quiet". It's like a mute button but specifically for progress bars and stuff ๐Ÿคซ.
  • --dry-run โ€” do not process files, show files that would be processed. It's a little preview, a vibe check before you commit ๐Ÿ‘€.

that's the whole vibe, bestie! catch you in the man page footer: rst-buildhtml(1) ๐Ÿ’–โœจ (version and date are chillin' there too, but you know we keep it cute). bye! ๐Ÿซถ

๐Ÿ“ฆ where this page comes from