0.0
No release in over 3 years
Low commit activity in last 3 years
This rubygem does not have a description or summary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7.0
~> 2.0.0.rc1
~> 10.3.2
~> 3.0.0
~> 0.24.0

Runtime

~> 2.6.1
 Project Readme

Inactive Project: I am no longer updating this, as I've switched to using embedded Gists for syntax highlighting on my blog

jekyll_prism

Gem Version Code Climate Coverage Status Build Status MIT Licensed

Jekyll plugin to add support for prism.js.

Usage

This adds code blocks and ext_code tags for syntax highlighting.

code block

The code block creates the necessary HTML for prism to do its thing:

{% code %}
#!/bin/bash

echo "I'm so cool"
{% endcode %}

You can also pass a language option to set the language used for highlighting:

{% code ruby %}
require 'cool_module'

puts "I'm so cool, for reals"
{% endcode %}

If you're using prism with the line numbers plugin, you can provide line numbers to highlight (use 'all' to highlight all lines):

{% code ruby 1,3 %}
require 'cool_module'

puts "I'm so cool, for reals"
{% endcode %}

ext_code tag

This tag uses the file highlight plugin for prism, and creates an HTML object to include external code:

{% ext_code /path/to/cool/code.rb %}

You can provide language and line number parameters for this as well, just like the code block:

{% ext_code /path/to/cooler/code.rb ruby 1,10-51,77,90 %}

Installation

  1. Add 'jekyll_prism' to the gems array in your _config.yml
  2. Add the prism.js and prism.css files to your site, as described on prism's site
  • Note: the ext_code tag uses the File Highlight plugin. If you don't include that, the tags won't work

License

jekyll_prism is released under the MIT License. See the bundled LICENSE file for details.