Skip to content
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

Code block line numbers #28

Closed
Megalomaniak opened this issue Sep 20, 2019 · 3 comments · Fixed by #30
Closed

Code block line numbers #28

Megalomaniak opened this issue Sep 20, 2019 · 3 comments · Fixed by #30
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Megalomaniak
Copy link
Collaborator

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.

@Megalomaniak Megalomaniak added bug Something isn't working good first issue Good for newcomers labels Sep 20, 2019
@TwistedTwigleg
Copy link
Owner

TwistedTwigleg commented Sep 20, 2019

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
Copy link
Collaborator Author

Megalomaniak commented Sep 20, 2019

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants