• Embedded Gists

    defunkt 24 Jul 2008

    Okay, this is obvious: you can now embed gists directly into your website, blog, project overview, myspace page, whatever.

    I’ve personally wanted this for a long time. May your code forever outlive your blog.

  • Comments

    henrik Thu Jul 24 03:21:07 -0700 2008

    Nice!

    In addition to “view raw”, “download” would be nice, but I suppose that’s not there because gist downloads are unfinished altogether?

    If I were to use this on my blog, I think I would want to change “This Gist brought to you by Github” to something shorter, perhaps only a linked “gist.github” logo. Would you allow that? “Allow” in the approval sense, not in the add-a-feature sense.

    PhilGeek Thu Jul 24 04:33:37 -0700 2008

    Is there a way that this could work with gists with multiple files?

    sd Thu Jul 24 06:12:02 -0700 2008

    it looks like the generated html has a div with id=“gist”. That breaks the html if you try to embed more than one gist on a page. You probably want to do something like id=“gist2059”, and if possible, append a random number.

    mbleigh Thu Jul 24 06:15:10 -0700 2008

    How does this work with multi-file Gists? I’d love to be able to Gistify my blog posts but keep all of the separate code sections together in a multi-file Gist.

    arthurgeek Thu Jul 24 07:22:55 -0700 2008

    Nice feature! I miss gists with multiple files support.

    britt Thu Jul 24 09:15:24 -0700 2008

    Awesome! The hits just keep on coming with you guys!

    briandoll Thu Jul 24 10:45:45 -0700 2008

    Great feature!

    It does look like there may be a bug in the presentation of certain characters that are translated by the js, rather than printed to the screen.

    Here is a gist that contains newline and tab chars (\n, \t) http://gist.github.com/384

    The output translates the \n characters as newlines and the tab char as a tab. This could be specific to the language the gist is in, as this particular gist is in Bash (while the code itself is actually Awk, which isn’t supported).

    JeremyBanks Thu Jul 24 13:17:06 -0700 2008

    Nice. I can see a plugin for different blogging software showing up some time, that’d be neat.

    ryantm Thu Jul 24 15:08:01 -0700 2008

    one thing that I noticed is that this embedding doesn’t show up in Google Reader.

    rgrove Sat Jul 26 10:52:05 -0700 2008

    What’s the point of using a table with a single row and a single column?

    defunkt Sat Jul 26 16:19:48 -0700 2008

    @rgrove you’re right, that was leftover from when i had line numbers in the embed. it’ll be fixed in the next push.

    dancroak Wed Jul 30 16:37:36 -0700 2008

    Having trouble with conflicting styles. Any advice on forcing the styles to look like it does above?

    Please log in to comment.