Fix lists in version information sections.

Review Request #12513 — Created Aug. 8, 2022 and submitted — Latest diff uploaded

Information

beanbag-docutils
master

Reviewers

When using Version Added, Version Changed, or Deprecated with a
numeric or bullet list, the rendering of the lines would break. This
wasn't anything special with these sections, and in fact likely applied
to others as well. Instead, it was a mistake make in the re-indent logic
for putting content into a section.

The logic was supposed to dedent a block of lines, removing the common
leading whitespace, and to then re-indent with 3 spaces. The 3
parameter for _indent() was put in the wrong place, and this instead
was being passed to _dedent(), taking the place of a parameter that,
if truthy, would dedent all whitespace.

This led to subsequent lines in multi-line list items turning into new
paragraphs.

This change fixes that argument issue.

Unit tests pass.

Saw that this fixed some documentation I was working on.

Changes between revision 1 and 2

orig
1
2

Commits

Summary ID Author
Fix lists in version information sections.
When using `Version Added`, `Version Changed`, or `Deprecated` with a numeric or bullet list, the rendering of the lines would break. This wasn't anything special with these sections, and in fact likely applied to others as well. Instead, it was a mistake make in the re-indent logic for putting content into a section. The logic was supposed to dedent a block of lines, removing the common leading whitespace, and to then re-indent with 3 spaces. The `3` parameter for `_indent()` was put in the wrong place, and this instead was being passed to `_dedent()`, taking the place of a parameter that, if truthy, would dedent all whitespace. This led to subsequent lines in multi-line list items turning into new paragraphs. This change fixes that argument issue, and it also removes the leading blank line before the content for these sections, in accordance with recommendations in Sphinx.
3b5bf9af747d78e44a4e23992d48913c28a6485e Christian Hammond
Fix lists in version information sections.
When using `Version Added`, `Version Changed`, or `Deprecated` with a numeric or bullet list, the rendering of the lines would break. This wasn't anything special with these sections, and in fact likely applied to others as well. Instead, it was a mistake make in the re-indent logic for putting content into a section. The logic was supposed to dedent a block of lines, removing the common leading whitespace, and to then re-indent with 3 spaces. The `3` parameter for `_indent()` was put in the wrong place, and this instead was being passed to `_dedent()`, taking the place of a parameter that, if truthy, would dedent all whitespace. This led to subsequent lines in multi-line list items turning into new paragraphs. This change fixes that argument issue.
0042284610145ae01bd3efa904f99aba52edbbfa Christian Hammond
beanbag_docutils/sphinx/ext/autodoc_utils.py
beanbag_docutils/sphinx/ext/tests/test_autodoc_utils.py
Loading...