I was looking for ways to post code on this blog. The two quickest and easiest options are gist.github.com and pastebin.com.
Gist comes with a couple caveats:
1. It won't work with "Dynamic View" template which would remove script tags.
2. the snippet is not a scrollable vertically.
I had to change the template because of the first issue, but 2nd issue bugs me as the code body can be hundreds of lines long most of the time. It'd not be very viewing friendly to show the whole length in a post.
Pastebin gives you the option to post snippet in an iframe which made it scrollable, and thus has no problem with Dynamic View. In case you're wondering, yes, I've tried to hack the gist script url as an embedded iframe like pastebin, but it did not work.
The advantage of using gist is that it becomes a github repository automatically. I'm a fan of github, but at the end, the goal is to post on the blog. So I went with pastebin. If Github can add the iframe option for the snippet, I'd use it in a heart beat.
No comments:
Post a Comment