- Go to http://gist.github.com
- Past the code you want to post
- Copy the embed tag
- Go back to blogger, and select "Edit Html"
- Paste the embed tag into your post
A potential drawback of this approach might be the stability of github as a company. In a downturn, it may shut down with very short notice.
Compare to using SyntaxHighlighter, personally, I think this approach is way better:
- No setup required (in a previous post I documented how to setup syntaxhighlighter for blogger, it took me half an hour to setup everything correctly. Now with gist, there is zero setup required );
- Faster to create code snippet in a post;
- Supports more languages;
- No need to worry about pasting XML, HTML, or other special characters;
To paste script like below used to require replacing '<' with < and '>' with > manually. Now is simply copy paste without any manual changes:
13 comments:
thanks, it save time than setting up syntaxhighlighter :)
Nice tip.
Thanks, i was looking exactly for something like that.
Does anyone know, how long the gists on gist.github.com will last (especially when creating an anonymous gist without a github account)?
Thx for the tip. Very helpful.
i was using syntaxhighlighter 1.5x quite happily for almost 6 months, until all of a sudden blogspot started to add extra linebreaks, making the code look far too spaced out. github/gist is definitely a great solution.
we can host the js and css ourselves :) it's a little bit more work but no big deal.
Thanks for the heads up!
I am having hard time having to get it work with gist and dynamic views of blogger. has any one else tried gist with dynamic views?
Unfortunateley, It does not work on the dynamic views.
Here is how to do embed gists in dynamic view
http://blog.moski.me/2012/01/gist-with-bloggers-dynamic-views.html
Thanks and very help for the post. I have did this for my blog aslo. aravindmv.blogspot.com
Wow, great website! I absolutely appreciated the articles material! Please keep it up writing about these postings, I’m able to more likely be subscribing subsequent!
website design
Post a Comment