jekyll/jekyll — pull request #2590 by hexid (2014-07-12 21:51:11+00:00)
Title: Refactor highlighter to allow for configuration

I have been working on adding highlighter settings to `_config.yml` for the past few days. So far I have been able to set default configurations for both Liquid and RedCarpet highlight blocks.

Currently, I am using the following structure in my `_config.yml` file to add inline line numbers to all highlight blocks:

tags:
highlight:
linenos: true

All of the following are affected by the prior configuration (assuming RedCarpet as the markdown engine for the first two):

```ruby
puts "Hello world!"
```

~~~ruby
puts "Hello world!"
~~~

{% highlight ruby %}
puts "Hello world!"
{% endhighlight %}

This, however, is not limited to the `linenos` options and can also be used with other options that affect the highlight tag, such as `hl_lines` and `linenostart`. Granted, this is assuming that you are using `pygments` as your highlighter.

If anyone could chime in about the below points, along with any concerns you might have, that would be greatly appreciated.

- [X] Moved highlight code to `lib/jekyll/highlighter.rb`
- [X] Allow configuration of Liquid HighlightBlock
- [X] Allow configuration of RedCarpet markdown highlighting (ref. #1887)
- [X] Add tests to make sure everything works
- [ ] Get feedback on configuration structure