This gist shows how I'm using Rouge to highlight individual lines of code. On top of the existing syntax highlighting.
I'm using Sitepress which uses markdown-rails under the hood. But this should be applicable to any application rendering markdown with Redcarpet - sub out ApplicationMarkdown
as your renderer.
Append @[]
when setting the language in a fenced code block to highlight lines of code. Dashes will cover the range, inclusive. Commas will highlight each line.
Examples:
```swift@[4-6] class Person { private let name: String init(name: String) { self.name = name } } ```
```ruby@[2,5] class Person attr_reader :name def initialize(name) @name = name end end ```