Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve line numbers #149
I made a gist showing a few different ways to implement line numbers, let me walk you through the pros and cons...
Table with separate lines:
Just throwing ideas out here, I think all three methods have advantages over the current system - I don't like the markup and CSS being used atm.
I propose adding the last two options, I don't know how difficult it is to wrap each line in a tag, but there is definitely a reason why it's the most common approach.
With this, people can do their zebra striping and have fluid gutters, but are also are given the option to use the CSS3 counter instead of HTML and copy code without the line numbers etc. Doing this with only CSS wouldn't need line numbers enabled at all, but that approach is basically a hack.
Those styles aren't inlined because it's reasonable that someone might want to override them, which they can't do if it's in the
<%= Rouge.highlight(sample.demo.encode('utf-8'), sample, @formatter) %>
No dice with
However, with the ones I can view, I see what you mean now; I can choose to select the line numbers or not, works nicely. It's not as nice as the CSS method, but definitely better than my table version.
What do you think about adding the two CSS methods then?
Ah, so it's being read as the wrong encoding. Do you think you could add