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.