Lets list and acknowledge some of the work that has already started happening around GitHub's Gist when it comes to using it for embedding code snippets in blogs:
-
Loading the Gist through an iFrame to shorten page load times.
-
A nice side effect is the ability to get around any non-working Blogger templates like the Dynamic Template that was recently released but doesn't work with an embedded Gist (remark date: Nov. 14th 2011).
New Ideas:
-
Tell the script to provide line numbers.
- Allow a line-start/offset and line-end/length attribute for the embedded script so that users can have one large file and then simply talk about the chunks in sections. This will remove the need to break up the original large Gist into multiple individual Gists.
- Tell the script the array or range of line numbers to highlight.
- The following Gist will look for a div with the id of "foo" and place the script's formatted content in there. It is an actual example of the code running on this blog page to perform basic highlighting:
Until all this happens, Syntax Highlighter will remain # 1!
0 comments:
Post a Comment