git - Display Github repository files directly in a blog -


i have blog , i'd add code snippets in of posts.

i found "gist" thing pretty handy looks works code directly paste in. i'm familiar syntax highlighter , similar tools still doesn't cover requirement.

i'd find useful tool allow display github repository files directly within blog. imagine giving gist url of repository file , pasting source gist provides post.

is there way link files in public github repository can display them in blog code snippet?

you can using tool called gist-it.

usage

take github file url , prefix http://gist-it.appspot.com , embed result within tag:

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

$file should follow github repository pattern of $user/$repository/raw/master/$path github/$file shorthand http://github.com/$file , works in same way

here's test made following guidelines.

enter image description here

works!


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -