publish_file no longer works with "BytesIO-like" objects.
Fixed in Docutils 0.22.4. Thank you for analysis and report.
Finalise documentation of changes for 0.22.4.
Thank you for the information. According to the IANA entry, Benja Fallenstein registered the "rst" MIME type because: The registrant just happened to have need of a registered media type for it. --- https://www.iana.org/assignments/media-types/text/prs.fallenstein.rst So the actual error is not the quoted part of the FAQ answer, but ... there is no registered MIME type for reStructuredText, .... It seems that with the switch of the source file extension from ".txt" to ".rst" in August 2024 some applications...
More documentation fixes.
Suggestion: Introduce a new Doctree element <line_break> in Docutils 1.0 add "br" to docutils.dtd and document it in https://docutils.sourceforge.io/docs/ref/doctree.html add new class docutils.nodes.line_break add visit_line_break() and depart_line_break() methods to Docutils writers. New standard directive line-break. Similar to "replace", "date", and "unicode", this directive may only be used in substitution definitions, e.g. .. |br| .. line-break:: I want a line break\ |br| before this text....
Thank you for the information. According to the IANA entry, Benja Fallenstein registered the "rst" MIME type because: The registrant just happened to have need of a registered media type for it. --- https://www.iana.org/assignments/media-types/text/prs.fallenstein.rst So the actual error is not the quoted part of the FAQ answer, but ... there is no registered MIME type for reStructuredText, .... It seems that with the switch of the source file extending from ".txt" to ".rst" in August 2024 some applications...
Wrong statement in "reStructuredText Specification"
Fixed in [r10271].
Documentation update
Fix statement in rST Specification example.
See also the discussion in Sphinx issue #8709. Use case: Changelogs of "pip" and "black" use version numbers as section titles: the auto-generated IDs are not stable but may change if a new section is inserted :( Workaround: use explicit targets starting with a letter like "v25.1.1" (this is what "pip" does). This works in Sphinx. In Docutils, the "self-link" uses ids[0] which is the auto-generated one. This will be solved in Docutils 0.23.
New value "auto" for "initial_header_level" config setting.
Announce upcoming changes.
More detailled description of the restrictions on transition placement.
Proposed patch: -- a/docutils/docs/ref/rst/restructuredtext.rst +++ b/docutils/docs/ref/rst/restructuredtext.rst @@ -179,7 +179,10 @@ Here are examples of `body elements`_: - Footnotes_:: .. [1] A footnote contains body elements, consistently - indented by at least 3 spaces. + indented by at least 1 space. + + The least indented line sets the reference + indentation, so this is a nested block quote. - Citations_:: The attached patch also adds some more examples and moves the paragraph about paragraph...
Wrong statement in "reStructuredText Specification"
docutils.io.FileInput: ensure read() returns a `str`.
publish_file no longer works with "BytesIO-like" objects.
Thank you for the report. The issue is fixed in [r10267].
combining unicode chars count in grid tables
Fixed in Docutils 0.22.3.
rst2html incorrectly converts tables with Combining Diacritical Marks into HTML
Fixed in Docutils 0.22.3.
Documentation update and fixes.
Simplify `ClassAttribute` transform.
Fixes for the "responsive" CSS style sheet.
Future-proof the test for valid parents of topics or sidebars.
Small edits in description of recent changes.
Relax test for valid parents of topics or sidebars.
Documentation update/fixes.
Better error message for substitution definitions.
Thank you for the contribution. Unfortunately, we cannot include the patch without a change in the Docutils specification, https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#standalone-hyperlinks, which limits the supported URI schemes to the ones listed in the Official IANA Registry of URI Schemes and the W3C's Retired Index of WWW Addressing Schemes. While I don't see a "gemini" URI scheme as a particular problematic case, adding non-registered schemes should be done with special...
Fix Unknown target name warning in roles.rst
Fixed in [r10249] (with different wording). Thanks for finding the broken link and the patch.
Documentation update/fixes.
rst2html incorrectly converts tables with Combining Diacritical Marks into HTML
Fixed in [r10251].
combining unicode chars count in grid tables
Fixed, now also for grid tables, in [r10251].
rST parser: allow for combining characters in grid tables.
Simplify `utils.column_indices()`.
Even when adjusting the grid, the parser goes wrong. See [bugs:#512].
error installing v0.22.1 on MacOS
Fixed with release 0.22.2. Thank you for report, analysis, and testing.
Documentation fixes.
Docutils 0.22.2 is out (without the *.swp file). @daeho-ro: Could you please try whether this solves the install problem?
The .__init__.py.swp file should definitely not be there... ... it seems this is not just another problem but the culprit.
Thanks for the additional info. It seems that install on MacOS (or just homebrew or snakemake, ...) trips over the spurious file while with Python's standard "pip" installment program or installing "by hand" the spurious file is just ignored. We will release a new version without the spurious file ASAP.
error installing v0.22.1 on MacOS
It seems that install on MacOS (or just homebrew or snakemake, ...) trip over the spurious file while with Python's standard "pip" installment program or installing "by hand" the spurious file is just ignored. We will release a new version without the spurious file ASAP.
I cannot reproduce the install problem here. Installing Docutils 0.22.1 with pip into a new created venv worked without problem, despite the spurious file. What is the OS? Which command was used for the install? Was there any output after Here's the output:? If you used pip, run it with increased verbosity and share the details: pip install <package-name> --verbose You may consider removing the spurious file /docutils-0.22.1/docutils/.__init__.py.swp from the wheel or tar.gz archive (or manually...
I cannot reproduce the install problem here. Installing Docutils 0.22.1 with pip into a new created venv worked without problem, despite the spurious file. What is the OS? Which command was used for the install? If you used pip, run it with increased verbosity and share the details: pip install <package-name> --verbose You may consider removing the spurious file /docutils-0.22.1/docutils/.__init__.py.swp from the wheel or tar.gz archive (or manually unpacking and then removing) and trying again.
rst2html incorrectly converts tables with Combining Diacritical Marks into HTML
The .__init__.py.swp file should definitely not be there.
Give better messages on malformed tables
Fixed in Docutils 0.22.1. Thanks again.
Test failure on Windows with embedded images
LaTeX writer fails to generate "labels" for some elements with "ids".
LaTeX writer fails to generate "labels" for some elements with "ids".
Fixed in Docutils 0.22.1.
errors for malformed tables do not indicate what the error is
Fixed in Docutils 0.22.1. Thanks again!
qemu build problem after docutils update to 0.22
Fixed in Docutils 0.22.1. Please reopen if there are still problems. Thank you for reporting and tests.
regression with docutils 0.22: unsupported operand type(s) for +: 'NoneType' and 'list'
Fixed in Docutils 0.22.1. Please reopen if there are still problems. Thank you for reporting and tests.
Release date for 0.22 is in the future
Fixed in Docutils 0.22.1. Thank you for reporting.
So I can think of any suitable tests, what would your definiton of safe be here? you should . there was a discussion on docutils lists recently (1y) on code injection some general unittests/functional tests are mandatory (was in aegis SCM) considerations remarks for the security documentation ?
things are speedier if there is documentation and tests (i assume you did test the patch so why not pass this on) in the patch. the real hard thing for me to check is ... is this safe ... loading directives into docutils any thoughts help ?
Supersedes [patches:#17].
Thank you for the report. Combining characters in grid tables are known to be problematic. See [bugs:#128] Mind, that the intended behaviour would be to get the "expected" result with the input +---+ | ç̌ | +---+ For simple tables, you can use the simple table syntax, where this problem is fixed: = == ç̌ OK = ==
Even when adjusting the grid, the parser goes wrong. See [bugs:512].
combining unicode chars count in grid tables
Announce change for label writing in latex writer.
Document the `<target>` element.
Thank you for testing. so it should be fine with Docutils 0.22.1.rc1.
Please try with Docutils 0.22.1.rc1.
Documentation amendments.
The remaining issue is a way to tell RSTState.nested_parse() that it shall use a new, separate title style hierarchy for section headings (similar to Sphinx nested_parse_to_nodes()).
Applied in [r10229].
Element after a section from nested parsing may be invalid. parsers.rst.RSTSTate.nested_parse() with match_titles=True (i.e. support for sections) leads to an invalid document tree, if the nested block contains a section but the element following the nested block is not a section. The structure model allows only a <section> as sibling after a <section>. An invalid doctree can be prevented if the following content is appended to the last nested section instead of its parent. The "nested" directive...
Small editorial changes.
rST parser: Use `section_level_offset` instead of `memo.section_level`.
Commit [r10226] fixes the regeression in Sphinx. In order to correctly support sections in nested parsing, it reverts to using memo.section_level to keep record of the current section level. This is cumbersome and error prone because it needs to be updated with every switch of the current node. The attached patch implements an alternative: Store the difference between the intended start level of nested parsing and the number of parents of the base node in the new attribute section_level_offset. Use...
The fix is implemented in [r10223].
Problems with nested parsing and sections.
rST parser: simplifications, fixes, and improvements
regression with docutils 0.22: unsupported operand type(s) for +: 'NoneType' and 'list'
This should be fixed in [r10227]. Could you re-try?
qemu build problem after docutils update to 0.22
This should be fixed in [r10227]. Could you re-try?
Adjustments for nested_parse().
rST parser: restore backwards compatibility of nested parsing.
Consider the use cases: a) A main document includes rST blocks from various different sources (other projects documentation, docstrings, ...). We cannot guarantee a consistent title style hierarchy across all inclusions and want to use a separate title style hierarchy in the included blocks. b) A main document includes chapters from other source files of the same project after an introductory section. The project uses consistent title styles in all files. We want a document-wide title style hierarchy,...
assuming the included document. is complete, has a consistent title hierarchy means first title-style is top, next is 2nd asf standard use case is to include the document at a position where it's top level is one below the current in the including document e.g. section l1 ========== section l2 ---------- .. included doc section l3 ========== section l4 ---------- .. including doc section l2 ---------- is there a use case for including and setting a different level, absolute or relative ?
assuming the included document. is complete, has a consistent title hierarchy means first title-style is top, next is 2nd asf standard use case is to include the document at a position where it's top level is one below the current in the including document e.g. section l1 ========== section l2 .. included doc section l3 ========== section l4 ---------- .. including doc section l2 is there a use case for including and setting a different level, absolute or relative ?
Problems with nested parsing and sections.
An alternative idea: nested parse uses the document-wide title style hierarchy if the "node" argument is left at its default value. The result of the nested parsing is directly added to the document (at the "current" node). Sections are appended according to their level.