Sep 13, 2018

Using GitHub Gist as a Syntax Highlighter for Your Blog or Website

GitHub Gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automatically versioned, forkable and usable from Git.

After you create your Gist, you will be presented with a confirmation page. Click the show embed link and copy/paste the script tag on to your website.

Now, when your page is loaded, your code will be pulled in from Github and automatically formatted. The syntax highlighting is auto-detected based on the extension of the file name that you enter, so be sure you add the appropriate level of detail.