root/platform/tdiary/plugin/gist.rb

Revision 38692, 0.5 kB (checked in by kakutani, 18 months ago)

rename outer div class name.

Line 
1# show code snippet via gist.github.com
2#
3# usage:
4#   gist(gist_id)
5#     - gist_id: The id of the code snippet on gitst.github.com (e.g. 2056 for http://gist.github.com/2056)
6#
7# Copyright (c) KAKUTANI Shintaro <http://kakutani.com/>
8# Distributed under the GPL
9
10def gist( gist_id )
11        gist_snippet_url = "http://gist.github.com/#{gist_id}"
12        return (<<-EOS).chomp
13<div class="gist_plugin"><script src="#{gist_snippet_url}.js"></script>
14<noscript><a href="#{gist_snippet_url}">gist:#{gist_id}</a></noscript></div>
15        EOS
16end
Note: See TracBrowser for help on using the browser.