Skip to content

Instantly share code, notes, and snippets.

View jacob-long's full-sized avatar

Jacob Long jacob-long

View GitHub Profile
@jacob-long
jacob-long / README.md
Created September 17, 2017 04:03
Prism.js line numbers plugin tweak

Notes on use

The idea here is that some of us always want line numbers but never want to add a "line-numbers" class to our HTML. This tweaked version of the plugin always adds the line numbers to any <pre> block that also has a language class that Prism will be highlighting.

To keep you from being boxed in, I've added an option to use the pre class to opt out by setting class = "no-line-numbers". If you are much more likely to want line numbers than to not want them, then this is the better way of doing things. If you think you usually don't want line numbers, then just use the plugin straight from Prism.

You should add this file after the main prism.js file on your page. Do not include the line-numbers plugin when you download Prism because you want this one to do the work and not conflict with the official one.

This may break at any time as the Prism.js teams changes the base functionality of the highlighter or the line numbers plugin.

@jacob-long
jacob-long / wercker.yml
Created December 24, 2016 21:58
Hugo to DigitalOcean Wercker file
box: ubuntu
build:
steps:
- arjen/hugo-build:
version: "0.17"
theme: theme-name
flags: --buildDrafts=false --noTimes
deploy:
steps:
- install-packages: