rst2xml(1)

πŸ‘‘ rst2xml β€” the Docutils-native XML maker πŸ‘‘

okay bestie, welcome to the rst2xml manual page, filed under the text processing section of the manual, section 1 πŸ’… (yes we're doing the whole manpage thing, and yes it ate).


✨ Name ✨

rst2xml β€” the girl that converts reST documents to XML πŸ¦‹


🌸 Synopsis 🌸

rst2xml [options] [<source> [<destination>]]

πŸ’– Description πŸ’–

So basically: she generates Docutils-native XML documents out of standalone reStructuredText sources β€” here's the whole tea on that: https://docutils.sourceforge.io/docs/ref/doctree.html 🫢

She reads from <source> (and if you don't hand her one, default is stdin, no thoughts head empty) and writes to <destination> (and if you don't give her one of those either, default is stdout, she's just yapping to the terminal fr fr).

Want the full settings reference? It's right here: https://docutils.sourceforge.io/docs/user/config.html β€” go be nosy, iykyk 🌈


πŸŽ€ Options πŸŽ€

🌟 General Docutils Options 🌟

  • --output-path=<destination>, --output=<destination> β€” name your output destination right here. Heads up: this one obsoletes the <destination> positional argument (she's moved on πŸ’…). Default: None (so, stdout).
  • --title=<title> β€” set the document title as metadata. Cute, on brand.
  • --generator, -g β€” include a "Generated by Docutils" credit and link. Give credit where it's due ✨
  • --no-generator β€” do NOT include a generator credit. humble queen behavior.
  • --date, -d β€” include the date at the end of the document (that's UTC, btw).
  • --time, -t β€” include the time and the date (also UTC ⏰).
  • --no-datestamp β€” no datestamp of any kind. none. zero. not even a little one.
  • --root-prefix=<path> β€” base directory for absolute paths when she's reading from the local filesystem. Default is "" (empty string, she's lowkey minimal).
  • --source-link, -s β€” include a "View document source" link πŸ‘€
  • --source-url=<URL> β€” use <URL> for a source link; and plot twist, this implies --source-link.
  • --no-source-link β€” do NOT include a "View document source" link. mystery girl.
  • --toc-entry-backlinks β€” link from section headers to TOC entries. (default) πŸ’«
  • --toc-top-backlinks β€” link from section headers to the top of the TOC. back to the beginning, iconic.
  • --no-toc-backlinks β€” disable backlinks to the table of contents entirely.
  • --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. anarchist vibes.
  • --strip-comments β€” remove comment elements from the document tree. gossip removal service.
  • --leave-comments β€” leave comment elements in the document tree. (default) keep the receipts.
  • --strip-elements-with-class=<class> β€” remove all elements with classes="<class>" from the document tree. ⚠️ Warning: potentially dangerous; use with caution. (This is a multiple-use option, so you can stack it.) > bestie please be careful, this one actually bites πŸ’€
  • --strip-class=<class> β€” remove all classes="<class>" attributes from elements in the document tree. ⚠️ Warning: potentially dangerous; use with caution. (Multiple-use option too.) > again: caution. she means it 😭
  • --report=<level>, -r <level> β€” report system messages at or higher than <level>. The levels: "info" or "1", "warning"/"2" (that's the default), "error"/"3", "severe"/"4", "none"/"5" πŸ“’
  • --verbose, -v β€” report all system messages. (Literally the same as --report=1.) she's telling you EVERYTHING.
  • --quiet, -q β€” report no system messages. (Same as --report=5.) not a single word.
  • --halt=<level> β€” halt execution at system messages at or above <level>. Levels work like in --report. Default: 4 (severe). she said stop right there πŸ›‘
  • --strict β€” halt at the slightest problem. Same as --halt=info. perfectionist era.
  • --exit-status=<level> β€” enable a non-zero exit status for non-halting system messages at or above <level>. Default: 5 (which is disabled).
  • --debug β€” enable debug-level system messages and diagnostics. detective mode πŸ”
  • --no-debug β€” disable debug output. (default)
  • --warnings=<file> β€” send the output of system messages to <file>. πŸ“¬
  • --traceback β€” enable Python tracebacks when Docutils is halted. the full story, no cuts.
  • --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 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 exists!! conditional queen.)
  • --version, -V β€” show this program's version number and exit.
  • --help, -h β€” show this help message and exit. hi bestie πŸ‘‹

🧚 Generic Parser Options 🧚

  • --no-file-insertion β€” disable directives that insert the contents of an external file; they get replaced with a "warning" system message. no outside snacks allowed.
  • --file-insertion-enabled β€” enable directives that insert the contents of an external file. (default) okay fine, bring the snacks.
  • --no-raw β€” disable the "raw" directive; replaced with a "warning" system message. 🚫
  • --raw-enabled β€” enable the "raw" directive. (default) raw is back on the menu.
  • --line-length-limit=<length> β€” maximal number of characters in an input line. Default 10 000. (she's got limits, and that's healthy πŸ’…)
  • --legacy-ids β€” keep identifiers backwards compatible. Default. nostalgic core.
  • --matching-ids β€” explicit targets use identifiers matching the reference name.
  • --validate β€” validate the document tree after parsing. vibe check βœ…
  • --no-validation β€” do not validate the document tree. (default) we're freestyling.

πŸ“ reStructuredText Parser Options πŸ“

  • --pep-references β€” recognize and link to standalone PEP references (like "PEP 258"). stan PEP.
  • --pep-base-url=<URL> β€” base URL for PEP references. Default "<https://peps.python.org/>".
  • --pep-file-url-template=<URL> β€” template for the PEP file part of the URL. Default "pep-%04d".
  • --rfc-references β€” recognize and link to standalone RFC references (like "RFC 822"). stan RFC too, we don't play favorites.
  • --rfc-base-url=<URL> β€” base URL for RFC references. Default "<https://tools.ietf.org/html/>".
  • --tab-width=<width> β€” set the number of spaces for tab expansion. Default 8. tab girlies rise.
  • --trim-footnote-reference-space β€” remove spaces before footnote references. tidy ✨
  • --leave-footnote-reference-space β€” leave spaces before footnote references. chaotic but valid.
  • --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"). curly quotes are a personality trait πŸŽ€
  • --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). This is the Default.
  • --character-level-inline-markup β€” inline markup recognized anywhere, regardless of surrounding characters. You must use backslash-escapes to avoid unwanted markup recognition. Useful for East Asian languages. Experimental. ⚠️ (experimental = she's still figuring it out, be nice)

πŸ’œ Standalone Reader Options πŸ’œ

  • --no-doc-title β€” disable the promotion of a lone top-level section title to document title (and the subsequent section title to document subtitle promotion; that whole thing is enabled by default). no promotions today.
  • --no-doc-info β€” disable the bibliographic field list transform (enabled by default).
  • --section-subtitles β€” activate the promotion of lone subsection titles to section subtitles (disabled by default). glow up: activated.
  • --no-section-subtitles β€” deactivate the promotion of lone subsection titles. glow down, respectfully.

🌈 "Docutils XML" Writer Options 🌈

  • --newlines β€” generate XML with newlines before and after tags.
  • --indents β€” generate XML with indents and newlines. (aesthetic ✨)
  • --no-xml-declaration β€” omit the XML declaration. Use with caution. > i'm just repeating what she said, this one's a risky move 😭
  • --no-doctype β€” omit the DOCTYPE declaration.

okay that's the entire page, you read the whole thing, I'm so proud of you 🫢 and for the record: this is the rst2xml page from the text processing manual, hanging out in section 1 β€” she's a classic, a legend, the moment πŸ’… no cap, go convert something pretty. mwah πŸ’–


πŸ“¦ where this page comes from