Embedding a File From Github as a Gist


This is probably the first personal site I’ve ever had that has quality syntax highlighting for code snippets. But there are still cases where it would be easier to include an example from a github repository wholesale. I’ve found a couple of services that handle this nicely.

I’ve been using Gist It, because the styles on this site conflict with Embed Like Gist.

For either of these services, it is as easy as embedding a script tag within the markdown file for my post.

## Markdown Heading
<script src="https://gist-it.appspot.com/github/robertkrimen/gist-it-example/blob/master/example.js"></script>
### More markdown

The output looks like this:

Handy trick, but but a tradeoff - highlighting the code in the post itself will work forever, but this approach will only work as long as the services exist.