March 23, 2007
_ google-code-prettify
# google-code-prettify.rb
#
# code syntax highlighting by google-code-prettify
# (http://code.google.com/p/google-code-prettify/)
add_header_proc do
if @mode !~ /conf$/ and not bot? then
<<-SCRIPT
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/prettify.js"></script>
<script langage="javascript">
//<!--
Event.observe(window, 'load', prettyPrint, false);
//-->
</script>
SCRIPT
end
end
def code(id, source)
r = %Q|<pre class="prettyprint" id="#{id}">\n|
r << CGI.escapeHTML(source) << "\n"
r << %Q|</pre>|
end
うひょひょ
[]
本日のPingbacks(全0件)
B4oS4p vkoo7wvY5Xkfak7bf1Th