DocBrowser v0.9

Syntax Highlighting

DocBrowser includes support for Prism syntax highlighting.

To syntax highlight code blocks, include a class="language-xxx" attribute on both the outer <pre> element and the inner <code> element.

(including the language attribute on both elements removes the need for Prism to add the class via script which can cause layout changes resulting in jitter/creeping on page refresh)

<pre class="language-markup"><code class="language-markup">

You'll also need to include the Prism.JS plugins for any languages you use. See the <head> section of the HTML layout for an example.

Subscribe for more like this. No spam, just fun tech stuff :)

Or, find me on Twitter: @toptensoftware.