Using syntax highlight from GitHub

Seb Nilsson picture Seb Nilsson · Jun 6, 2011 · Viewed 19.1k times · Source

What syntax highlighting is used on GitHub (for HTML, CSS, JavaScript, C#) when viewing source code-file and is it available for the public to use?

It works on the page and it works when embedding on a page (from a Gist), like this:

<script src="https://gist.github.com/1009439.js"></script>

But can I just include their JavaScript-library and let it highlight my code?

Answer

Stephen Diehl picture Stephen Diehl · Jun 6, 2011

Github uses pygments to highlight syntax. Pygments is running on the server, instead of a pure Javascript client solution. If you're looking for a Javascript solution check out this review of the various options.