middleman / middleman-syntax

Code syntax highlighting plugin via Rouge for Middleman
https://middlemanapp.com
MIT License
179 stars 57 forks source link

Line numbers not working #27

Closed airblade closed 11 years ago

airblade commented 11 years ago

I've configured things as per the README:

require 'redcarpet'
set :markdown_engine, :redcarpet
set :markdown, hard_wrap: true, fenced_code_blocks: true, smartypants: true
activate :syntax, linenos: 'inline', anchorlinenos: true, linenostart: 2

My blog article has this:

```ruby
def my_cool_method(message)
  puts message
end


The result is correctly syntax-highlighted but there aren't any line numbers.

I'm using middleman-syntax 1.2.1, rouge 0.3.10, middleman-blog 3.2.0, redcarpet 3.0.0.
bhollis commented 11 years ago

Rouge doesn't support those options. Try this:

activate :syntax, line_numbers: true

See https://github.com/jayferd/rouge/blob/master/lib/rouge/formatters/html.rb for Rouge's formatter options.

airblade commented 11 years ago

Thank you. I looked everywhere for those options (except there).

I've just submitted a pull request (#28) to fix the example rouge options in your README.