Skip to content

Instantly share code, notes, and snippets.

View pdog18's full-sized avatar
🏠
Working from home

Jie Gao pdog18

🏠
Working from home
View GitHub Profile
@zpao
zpao / code_highlight_lines.rb
Created May 10, 2013 20:19
Highlight specific lines of code with Markdown + Jekyll + Redcarpet
# Replace Jekyll's handling of the Redcarpet code_block (which already adds
# support for highlighting, but needs support for the very non-standard
# "code fences with line highlights" extension).
# Since this is currently depending on Redcarpet to cooperate, we are going to
# be naive, and only allow line highlighting when a language is specified. If
# you don't want any syntax highlighting but want to highlight lines, then you
# need to specify text as your language (or it will break), like:
# ```text{4}
module Jekyll