rst2pseudoxml(1)
πΈ NAME πΈ
rst2pseudoxml β bestie, this is the little glow-up machine that turns reST documents into pseudo-XML β¨ (it's rst2pseudoxml(1), if you're keeping track of the manual number, and honestly iconic of it)
π¦ SYNOPSIS π¦
rst2pseudoxml [options] [<source> [<destination>]]
π DESCRIPTION π
Okay so picture this: you've got a standalone reStructuredText source, and you want a pseudo-XML (test) document out the other side. That's the whole gig, no cap. It's giving "doctree, but visible" π
Here's the link if you wanna see what that doctree thing actually is: https://docutils.sourceforge.io/docs/ref/doctree.html π₯
It reads from <source> β and if you don't hand it one, it just reads from stdin, like sure, whatever, it's flexible π
β and it writes to <destination>, which defaults to stdout if you don't say otherwise.
And for the full settings reference, the mothership is right here: https://docutils.sourceforge.io/docs/user/config.html π
π OPTIONS π
β¨ General Docutils Options β¨
--output-path=<destination>,--output=<destination>β names where the output goes. This one obsoletes the<destination>positional argument (rip bozo, it's legacy now). Default:None, which means stdout π--title=<title>β sets the document title as metadata, slay--generator,-gβ drops in a "Generated by Docutils" credit plus a link π«Ά--no-generatorβ no generator credit, periodt--date,-dβ sticks the date at the end of the document (UTC) π--time,-tβ sticks the time & date in there (UTC) β°--no-datestampβ no datestamp of any kind, not even a little one--root-prefix=<path>β the base directory used for absolute paths when it's reading from your local filesystem. Default is""--source-link,-sβ includes a "View document source" link π--source-url=<URL>β uses<URL>for the source link; heads up, this implies--source-link--no-source-linkβ no "View document source" link, we're shy today π--toc-entry-backlinksβ links from section headers back to TOC entries (this is the default, bestie)--toc-top-backlinksβ links from section headers to the top of the TOC instead--no-toc-backlinksβ turns off backlinks to the table of contents entirely--footnote-backlinksβ links from footnotes/citations back to their references (default πΈ)--no-footnote-backlinksβ disables backlinks from footnotes and citations--section-numberingβ lets Docutils number your sections (default π )--no-section-numberingβ Docutils, hands off the numbering--strip-commentsβ removes comment elements from the document tree--leave-commentsβ leaves comment elements in the document tree (default)--strip-elements-with-class=<class>β removes every element withclasses="<class>"from the document tree. > Warning: potentially dangerous; use with caution. (Multiple-use option β you can stack it.)--strip-class=<class>β removes allclasses="<class>"attributes from elements in the document tree. > Warning: potentially dangerous; use with caution. (Multiple-use option, same deal.)--report=<level>,-r <level>β reports system messages at or above<level>:"info"or"1","warning"/"2"(default),"error"/"3","severe"/"4","none"/"5"π’--verbose,-vβ reports all system messages. (Same as--report=1.)--quiet,-qβ reports no system messages at all. (Same as--report=5.) π€«--halt=<level>β halts execution at system messages at or above<level>. Levels work the same as--report. Default:4(severe) π--strictβ halts at the slightest problem. Same as--halt=info. girl is sensitive, respect it π--exit-status=<level>β enables a non-zero exit status for non-halting system messages at or above<level>. Default:5(disabled)--debugβ enables debug-level system messages and diagnostics π--no-debugβ disables debug output. (default)--warnings=<file>β sends the output of system messages to<file>--tracebackβ enables Python tracebacks when Docutils is halted--no-tracebackβ disables 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>β writes output file dependencies to<file>--config=<file>β reads configuration settings from<file>, if it exists--version,-Vβ shows this program's version number and exits--help,-hβ shows this help message and exits
π 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 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>β maximal number of characters in an input line. Default10 000--legacy-idsβ keeps identifiers backwards compatible. Default.--matching-idsβ explicit targets use identifiers matching the reference name.--validateβ validates the document tree after parsing β--no-validationβ does not validate the document tree. (default)
π§ reStructuredText Parser Options π§
--pep-referencesβ recognizes and links 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 the PEP file part of the URL. (default"pep-%04d")--rfc-referencesβ recognizes and links 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>β sets the number of spaces for tab expansion (default8)--trim-footnote-reference-spaceβ removes spaces before footnote references--leave-footnote-reference-spaceβ leaves 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>β changes straight quotation marks into typographic form: one of"yes","no","alt[ernative]"(default"no")--smartquotes-locales=<language:quotes[,language:quotes,...]>β which characters to use as "smart quotes" for<language>--word-level-inline-markupβ inline markup is 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 is recognized anywhere, regardless of the surrounding characters. Backslash-escapes must be used to avoid unwanted markup recognition. Useful for East Asian languages. Experimental, so, y'know, proceed with the vibes π§ͺ
π Standalone Reader Options π
--no-doc-titleβ disables the promotion of a lone top-level section title to document title (and the subsequent section title to document subtitle promotion, which is enabled by default)--no-doc-infoβ disables the bibliographic field list transform (which is enabled by default)--section-subtitlesβ activates the promotion of lone subsection titles to section subtitles (disabled by default)--no-section-subtitlesβ deactivates the promotion of lone subsection titles
π "Docutils pseudo-XML" Writer Options π
--detailedβ pretty-prints#textnodes π
ok that's the whole thing, you ate that honestly π
Sign-off time, bestie: this little masterpiece is rst2pseudoxml(1), filed under text processing π, and it lives in the same docutils source as all its siblings. Go forth and generate pseudo-XML, you main character π
β¨π¦
π¦ 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