The Chirpy theme does not natively support highlighting text inside code blocks. This plugin, together with a small CSS snippet, adds the ability to highlight specific parts of code.
- Copy
highlight_code.rbinto your_pluginsfolder. - Copy
highlight_code.cssinto/assets/css/highlight_code.css - Update
_layouts/post.htmlto include the new stylesheet by appending<link rel="stylesheet" href="{{ '/assets/css/highlight_code.css' | relative_url }}">at the end of the file - Add the required gems to your Gemfile:
gem "nokogiri"
Write your code blocks as usual. To highlight a portion of text inside them, wrap the text with double equal signs:
This is an ==example==
You can change the colour of the highlighted code wihin the css file. The symbols used to select the code to highlight the code can also be changed to your liking in the ruby file.


