Skip to content

cesar-guillen/Jekyll-Chirpy-Code-Highlighter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jekyll-Chirpy Code Highlighter

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.

Example

example example

Installation

  1. Copy highlight_code.rb into your _plugins folder.
  2. Copy highlight_code.css into /assets/css/highlight_code.css
  3. Update _layouts/post.html to include the new stylesheet by appending <link rel="stylesheet" href="{{ '/assets/css/highlight_code.css' | relative_url }}"> at the end of the file
  4. Add the required gems to your Gemfile:
gem "nokogiri"

Usage

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==

example

Customization

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.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks