|
From: Guenter M. <mi...@us...> - 2026-01-26 10:41:53
|
On 2026-01-24, Matěj Cepl wrote: > [-- Type: text/plain, Encoding: quoted-printable --] > I was trying to compensate for openSUSE package of python3-myst-reader > missing script for missing `myst-docutils-odt` script by trying to pipe > the output of `myst-docutils-xml` to `docutils` and the result doesn't > seem to work: ... > AttributeError: 'str' object has no attribute 'transformer' and no __dict__ for setting new attributes The "xml" writer generates an XML document in the "Docutils XML" format that can be written to a file or saved as string. The "doctree" writer generates a Python data structure that can be passed on to a writer, processed, or stored/pickled by other Python functions, classes, or modules. Docutils supports the use of 3rd party parsers like "MySt" with the "generic front-end": To generate a HTML5 document from Markdown input, use docutils --parser=myst To get ODT output from Markdown documents, try docutils --parser=myst --writer=odt To get ODT output from Docutils-XML documents, use docutils --parser=xml --writer=odt Caveats: * parsing "Markdown" input with 3rd party parsers myst, pycmark, or recommonmark requires Docutils >= 0.19 (2022-07-05) * parsing "Docutils XML" requires Docutils >= 0.22 (2025-07-29) * The MyST parser is not extensively tested with Docutils writers. * The OTD writer has known (and unknown) limitations. Pleas report problems with the Docutils parsers and writers here (or in the bug tracker) and problems with the MyST parser to the original author. To find out whether the problem is with MyST or Docutils, it may help to validate the generated "doctree": docutils --parser=myst --validate --writer=xml minimal-example.md Ahoj Günter |