Is there a way to embed github code into an iframe?

I just found a way to do this using Gist-it

Usage

Take a github file url and prefix it with http://gist-it.appspot.com and embed the result within a tag:

<script src="http://gist-it.appspot.com/http://github.com/$file"></script>

Here's a test I just made. Works! :)

enter image description here


A GitHub page itself wouldn't be put directly in a iframe (because of the X-Frame-Options: deny HTTP header).

That leaves you with the GitHub API for contents

GET /repos/:owner/:repo/contents/:path

Like: https://api.github.com/repos/ileathan/hubot-mubot/contents/src/mubot.coffee.

You should be able to put that content in a iframe (as in this answer)

Tags:

Iframe

Github