astropy / astropy-helpers

Helpers for Astropy and Affiliated packages
BSD 3-Clause "New" or "Revised" License
28 stars 42 forks source link

bootstrap-astropy.css messes up line numbering on sphinx code blocks #179

Closed RiceMunk closed 9 years ago

RiceMunk commented 9 years ago

Currently working on the documentation for something I'm trying to get released as an astropy affiliated package, and I found a problem with how numbered code blocks are rendered using the astropy sphinx css stuff.

Here's a screenshot of what happens (at least with Chrome and Firefox) if I try to make a line-numbered code block in sphinx (using the code-block::-markup): sphinx_codeblock_wrong

The line numbering on that is not very useful, so it's a problem for my attempt at writing examples.

After a while of scrathing my head and learning how the element inspection thingy on Chrome works, I found out that this is because of something in bootstrap-astropy.css. Turns out that, for reasons I don't really understand, the line "white-space: pre-wrap;" in the pre-block (line 153 in bootstrap-astropy.css) is causing this problem. If I remove that line from the css, I get something a bit better-looking: sphinx_codeblock_lesswrong

Gonna modify the css in the thingy I'm working on to not cause the line numbering issue, but I figured you people would wanna know about this as well.

embray commented 9 years ago

That's odd. I think none of the Astropy docs use line numbering, so it hadn't come up before. I'm not sure why this happens either--thanks for the report.

RiceMunk commented 9 years ago

No problem. I went ahead and made a pull request for the quick fix I made.

Not sure if that's the best way of going about getting rid of this issue but there you have it. See pull request #180.

embray commented 9 years ago

Fixed by #180--thanks @RiceMunk