because I can

Code Syntax Highlighting - Prism

I've been looking for web pages that show code in a pretty way. I found one - Prism. And I've reproduced the results below. All it takes is two tags:

  • <pre class="language-html">
  • <code>

Enclose the code to be highlighted in these two tags.

Then go to the Prism website, select the core version plus any additional languages you need (don't choose many), then at the bottom of the page, click the buttons to get the css and the js files.

Here's my sample:

<!DOCTYPE html>
          <meta charset="utf-8">
          <title>Mocha Tests</title>
          <link rel="stylesheet" href="../bower_components/mocha/mocha.css" />
          <div id="mocha"></div>
          <script src="../bower_components/chai/chai.js"></script>
          <script src="../bower_components/mocha/mocha.js"></script>
          <script src="../js/functions.js"></script>
          <script src="test.js"></script>