TwistedTwigleg / vanilla-bootstrap

Kickstart your Vanilla-powered community forums with a fresh and solid theme that is ready to be customized to your heart's desires.
http://vanillaforums.org/addon/bootstrap-theme
MIT License
0 stars 0 forks source link

Code block line numbers #28

Closed Megalomaniak closed 5 years ago

Megalomaniak commented 5 years ago

Currently only every fifth line gets a line number displayed, causing empty lines in code to be cut out, which is a bit of a problem, but it should be an easy fix I think.

TwistedTwigleg commented 5 years ago

Looking at the CSS, it should be super easy. All of the line marks are there for every line as ::marker. The ::marker fields are hidden by default with a line style type: none. Overriding this should fix the issue and would go a long way to making code on the forums more readable.

Megalomaniak commented 5 years ago

https://github.com/google/code-prettify#how-can-i-put-line-numbers-on-every-line-instead-of-just-every-fifth-line

How can I put line numbers on every line instead of just every fifth line?

Prettify puts lines into an HTML list element so that line numbers aren't caught by copy/paste, and the line numbering is controlled by CSS in the default stylesheet, prettify.css.

The following should turn line numbering back on for the other lines:

<style>
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8 {
  list-style-type: decimal !important;
}
</style>
TwistedTwigleg commented 5 years ago

Awesome! Then all we should need to do is paste that into the theme and we should be good to go.