Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

gist.github.com has a great feature where you can embed the current version of a file in a blog via a <script/> tag.

However, I can't seem to embed an older revision, or the current atomic revision in such a way, that further commits won't update what's embedded by the embed tag. Is this possible?

share|improve this question
    
So you want to post static content that is highlighted basically. –  phwd Jan 15 '12 at 19:58
    
@phwd Well, the idea is that I would have a blog article about a specific revision of the file. In the future I might have a different revision, which I might or might not embed anywhere. Now imagine if this embed functionality was part of regular github repos. Maybe I wanted to embed a particular commit in a blog (or bug tracking system) –  Justin Dearing Jan 15 '12 at 22:57

2 Answers 2

up vote 6 down vote accepted

Just add .js to the end of the URL like this: https://gist.github.com/1522901/0f74d53b18060f6292db9dc4d6c1922f72aa2aaf.js

share|improve this answer

Unless Github makes this possible (perhaps with a feature request/service hook), one easy way would be to simply display the contents of the gist using its complete url along with the commit hash, such as https://gist.github.com/1522901/0f74d53b18060f6292db9dc4d6c1922f72aa2aaf, and then just use some third party code highlighting library for displaying it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.