-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rendering of footnotes and citations for Sphinx 2 #784
Conversation
I took a different approach with this, using flex: However, it's flex, which is not a great application for converting lists into tables. But it's not playing around with floats at least. Is the tabular display of footnotes something worth preserving? One area that it doesn't look correct, because it's sized proportionally: |
Is there a reason footnotes were changed from tables to definition lists? Even if you change the styling via CSS to get rid of the ugly background and border, short of jumping through flex hoops as @agjohnson shows, you're still stuck with the disconnected presentation of a footnote number with its associated content on the next line; it looks terrible and takes up way more space than necessary. This provokes my distaste for markup languages that presume to know what you want and often get it wrong. |
Sphinx 2 uses it's HTML 5 writer by default, which outputs definition lists. Sphinx < 2 uses the HTML 4 writer by default, which use a table output for footnotes. |
Perhaps this is a regression or they have a good reason for this. |
Perhaps, but I fail to see one. I'm advocating for dropping the use of footnotes altogether, or hand-coding them with embedded html, which defeats the purpose of markup to begin with. <insert "disappointed" emoji here> |
On a positive note, I just found this and will try the various suggestions until I find one that works for us: https://stackoverflow.com/questions/1713048/how-to-style-dt-and-dd-so-they-are-on-the-same-line/21261303#21261303 This solution is the simplest and works like a charm (coupled with a bit of additional CSS to clean up the margin, padding, line-height, and font-size of the various elements to get everything to line up the way I wanted):
|
That is the ideal CSS fix, however I think that the most compatible way that we can address this is to override the writer being used by the builder and output a more helpful structure. For now, a fix like this PR presents the least number of issues and doesn't harshly affect display. |
@agjohnson I would be OK with dropping the tabular (it's what sphinx does after all), hence my PR. Floats and flex have the annoying habit to produce corner cases that look completely off. |
@agjohnson do you approve this PR? |
I think I've come around to CSS The fixes are in #838, which supersedes the need for this PR |
I think we can agree on using #838 as a proper fix here. |
Sphinx 2 uses definition lists for footnotes and citations instead of tables, yay!
The existing theme CSS undid most of the default styling wyrm applied to tables so footnotes looked better. I've added similar styles for Sphinx 2. The rendering for Sphinx < 2 is unaffected.
There are minor visual differences, review is appreciated.
Sphinx <2:
Sphinx >2:
Differences:
(1,2)
links) are not aligned with the footnote text due to different DOM structure. I do not consider this an issueFixes #741