|
Revision 16782, 0.5 kB
(checked in by kakutani, 4 months ago)
|
|
platform/tdiary/plugin/gist.rb, platform/tdiary/spec/gist_spec.rb: added <noscript> and <div> tag.
|
| Line | |
|---|
| 1 | # show code snippet via gist.github.com |
|---|
| 2 | # |
|---|
| 3 | # usage: |
|---|
| 4 | # flickr(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 | |
|---|
| 10 | def gist( gist_id ) |
|---|
| 11 | gist_snippet_url = "http://gist.github.com/#{gist_id}" |
|---|
| 12 | return (<<-EOS).chomp |
|---|
| 13 | <div class="gist"><script src="#{gist_snippet_url}.js"></script> |
|---|
| 14 | <noscript><a href="#{gist_snippet_url}">gist:#{gist_id}</a></noscript></div> |
|---|
| 15 | EOS |
|---|
| 16 | end |
|---|