From: Pradyun G. <pr...@us...> - 2022-06-07 14:14:37
|
Fun, SourceForge does not allow users to reply via email. > We don't know whether the patch solves the OP's problem. The rendering in https://pradyunsg.me/furo/kitchen-sink/generic/#footnotes cannot be reproduced easily even with the patch, as every footnote has its own grid (as opposed to one grid for the list of footnotes in the example). That's correct. It does not. In my example, `<div class="footnote-label">` functionally replaces the `dt` and the content div replaces the `dd` from 0.17. It changes the `footnote` to being a wrapper around the divs, which come in pairs. In effect, mirroring the structure from before (with an `aside` rather than `dl`, and divs rather than `dt` and `dd`). > I am hesitant to introduce an incompatible API change unannounced and in the last minute . It has the potential to break custom style sheets. "incompatible API change" seems like a weak reason for hesitancy for accepting a patch, since an incompatible API change in 0.18 (compared to 0.17) is literally what caused this issue. Does docutils announce upcoming releases and their changes somewhere *before* the release is made? If not, I can tell you that end users will not care if the change was made 1 hour, 1 week, 18 weeks before the release. :) --- ** [bugs:#450] 0.18: New HTML markup for footnotes is difficult to stylise** **Status:** open **Labels:** footnotes **Created:** Sun Jun 05, 2022 08:28 PM UTC by Pradyun Gedam **Last Updated:** Tue Jun 07, 2022 01:51 PM UTC **Owner:** nobody Docutils 0.18 changed the HTML markup for footnotes/citations generated for rst documents. This changed markup is significantly more difficult to stylise with CSS, in ways that was possible with Docutils 0.17. This has negatively affected HTML themes for Sphinx, since the Sphinx 5 release allows using docutils 0.18, which is preferentially installed by `pip`. The reasons for this boils down to an inconsistent number of elements inside each `aside`. 1. It's not possible use CSS grid layouts sanely, with this setup. 2. Even if you added multiple rules based on number of elements in the section, it's not possible to know what the 2nd element might be -- which balloons the complexity+size of the stylesheet, if it tries to accomodate for this. It is theoretically possible to stylise this but it would be on the order of 100s of lines of CSS to get this right, compared to ~20 with 0.17. Would it be possible to change this markup, to wrap the label & backrefs in a `div` and to wrap the content paragraphs in a separate `div` as well? This would make it possible to stylise this content in ways that were feasible with 0.17, with significantly less complexity in the stylesheets. --- Sources: ``` [some content that references these footnotes] .. [1] A footnote contains body elements, consistently indented by at least 3 spaces. This is the footnote's second paragraph. .. [#label] Footnotes may be numbered, either manually (as in [1]_) or automatically using a "#"-prefixed label. This footnote has a label so it can be referred to from multiple places, both as a footnote reference ([#label]_) and as a hyperlink reference (label_). ``` 0.17 output HTML: ``` <dl class="footnote brackets"> <dt class="label" id="id6"><span class="brackets">1</span><span class="fn-backref">(<a href="#id1">1</a>,<a href="#id7">2</a>)</span></dt> <dd> <p>A footnote contains body elements, consistently indented by at least 3 spaces.</p> <p>This is the footnote’s second paragraph.</p> </dd> <dt class="label" id="label"><span class="brackets">2</span><span class="fn-backref">(<a href="#id3">1</a>,<a href="#id8">2</a>)</span></dt> <dd> <p>Footnotes may be numbered, either manually (as in <a class="footnote-reference brackets" href="#id6" id="id7">1</a>) or automatically using a “#”-prefixed label. This footnote has a label so it can be referred to from multiple places, both as a footnote reference (<a class="footnote-reference brackets" href="#label" id="id8">2</a>) and as a hyperlink reference (<a class="reference internal" href="#label">label</a>).</p> </dd> </dl> ``` 0.18 output HTML: ``` <aside class="footnote brackets" id="id6" role="note"> <span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span> <span class="backrefs">(<a href="#id1" role="doc-backlink">1</a>,<a href="#id7" role="doc-backlink">2</a>)</span> <p>A footnote contains body elements, consistently indented by at least 3 spaces.</p> <p>This is the footnote’s second paragraph.</p> </aside> <aside class="footnote brackets" id="label" role="note"> <span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span> <span class="backrefs">(<a href="#id3" role="doc-backlink">1</a>,<a href="#id8" role="doc-backlink">2</a>)</span> <p>Footnotes may be numbered, either manually (as in <a class="footnote-reference brackets" href="#id6" id="id7" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>) or automatically using a “#”-prefixed label. This footnote has a label so it can be referred to from multiple places, both as a footnote reference (<a class="footnote-reference brackets" href="#label" id="id8" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>) and as a hyperlink reference (<a class="reference internal" href="#label">label</a>).</p> </aside> ``` The suggested change to the markup is to generate something like (using only the first aside for this demo): ``` <aside class="footnote brackets" id="id6" role="note"> <div class="footnote-label"> <span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span> <span class="backrefs">(<a href="#id1" role="doc-backlink">1</a>,<a href="#id7" role="doc-backlink">2</a>)</span> </div> <div class="footnote-content"> <p>A footnote contains body elements, consistently indented by at least 3 spaces.</p> <p>This is the footnote’s second paragraph.</p> </div> </aside> ``` --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |