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

Enabling line numbers adds too much space before codes #67

Closed
geeknerd opened this issue Oct 18, 2017 · 1 comment
Closed

Enabling line numbers adds too much space before codes #67

geeknerd opened this issue Oct 18, 2017 · 1 comment

Comments

@geeknerd
Copy link

Line numbers with Rouge has been giving me headaches for a long time and I tried to enable line numbers on this theme, deployed locally, it still gives too much space between the number and the codes. Also the alignment is just way off each other. Looks like Jekyll treats line number and codes as a two column table but I couldn't find a proper way to resize the column in the css file. Anyone has any idea?
To enable the line numbers I edited the _config.yml file

kramdown:
  input:          GFM
  # https://github.com/jekyll/jekyll/pull/4090
  syntax_highlighter: rouge

  # Rouge Highlighter in Kramdown › http://kramdown.gettalong.org/syntax_highlighter/rouge.html
  # span, block element options fall back to global
  syntax_highlighter_opts:
    # Rouge Options › https://github.com/jneen/rouge#full-options
    css_class: 'highlight'
    #line_numbers: true # bad idea, spans don't need linenos and would inherit this option
    span:
      line_numbers: false
    block:
      line_numbers: true
      start_line: 1

And the result looks like this:
Syntax Highlighting with line numbers

@geeknerd
Copy link
Author

I think I found a work-around for this issue. Just need to modify the syntaxhighliting scss file a little bit.
Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant