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 withclasses="<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 allclasses="<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. Default10 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. Default8. 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
- 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