This brings the great styles and metadata support found in the Octopress Code Highlighter to Middleman. This has some additional features beyond that to support the work being done for Habitat.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install middleman-vegas
Activate it to the Middleman
You can define code fences as you would normally. These code fences have support for the languages defined in rouge.
Define a code fence with a language.
```lang [code] ```
Define a code fence for a language with the addition of a title.
```lang title [code] ```
Define a code fence for a language with additional metadata
```lang [metadata] [code] ```
The additional metadata that can be specified:
||Used by the syntax highlighter. Passing 'plain' disables highlighting.|
||Add a figcaption title to your code block.|
||No default value|
||Text for the link, default:
||Enables line numbering|
||Start the line numbering at the given value.|
||Highlight lines of code. This example marks lines 1,2,3,4 and 8|
||Add CSS class names to the code
After checking out the repo, run
bin/setup to install dependencies. You can also run
bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run
bundle exec rake install. To release a new version, update the version number in
version.rb, and then run
bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the
.gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/burtlo/middleman-vegas. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Middleman::Octopress::Code::Highlighter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.