bitprophet / releases

A powerful Sphinx changelog-generating extension.
http://releases.readthedocs.io/
BSD 2-Clause "Simplified" License
176 stars 41 forks source link

Fix multi-paragraph issue entries #23

Closed bitprophet closed 10 years ago

bitprophet commented 10 years ago

Example:

* :bug:`122` Yup.
* :bug:`123` Foo the bars and stuff. blah blah.

  Also more stuff related to 123 cuz wow, such bugfix, very commits, so complex.
* :feature:`120` Some other asshole

Current released version actually ignores the 2nd paragraph for bug 123 due to implementation details.

I have a fix already in place (changes implementation to be more flexible, pull issue out while replacing it, then re-insert instead of recreating structure from whole cloth) but remaining:

bitprophet commented 10 years ago

Hrmph, yea I even have some multi "block" items in the Paramiko changelog where the 2nd item isn't even a paragraph but is eg a nested list. So making assumptions about that (aka the "replace with BR tags" idea) is just not gonna fly.

Similarly, attempting to tweak styling as I was thinking - remove the bottom-margin on p.first, then add top-margin on :not(p.first) or however one uses :not - also doesn't work well because we'd have to do that for every conceivable node type somebody might stuff in here.

bitprophet commented 10 years ago

Might have to/be able to do something ultra horrid like subclass builder classes and modify this behavior in one form or another. Ideally what I need, as above, is just for everything to be consistent so it can then be consistently styled; alternately, for the "non first" items to be what get a special class.

bitprophet commented 10 years ago

I don't see any way to handle this that both avoids a styling requirement and won't break on nontrivial scenarios. So we need some styling.

I think I can use CSS3 for this and neatly solve it:

div#changelog > div.section > ul > li > p:only-child {
    margin-bottom: 0;
}

Only downside here (and it's possible this was why the docutils behavior was added) is that subsequent paragraphs within list-items might not be immediately obviously related to the previous ones (especially if the multi-para list item is the last one in its list.)

However I think it's clear enough, at least under the Alabaster theme, and is at least consistent everywhere. Ideally we'd have some cute little vertical line or other way of associating the items, but meh.

bitprophet commented 10 years ago

So that works and the test suite finally passes fully again. Confirmed bugfix as well by reverting impl while preserving test suite, and the new test re: complex issue bodies does fail