Skip to content

Instantly share code, notes, and snippets.

@tamoot
Created December 27, 2010 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamoot/756250 to your computer and use it in GitHub Desktop.
Save tamoot/756250 to your computer and use it in GitHub Desktop.
if /\A(?:latest|day|month|nyear|preview)\z/ =~ @mode then
add_header_proc do
<<-HTML
<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script>
<script type="text/javascript"><!--
function google_prettify(){
prettyPrint();
}
if(window.addEventListener){
window.addEventListener("load",google_prettify,false);
}else if(window.attachEvent){
window.attachEvent("onload",google_prettify);
}else{
window.onload=google_prettify;
}
// --></script>
HTML
end
end
def code_prettify(src_code)
%Q|<div><pre class="prettyprint">#{CGI::escapeHTML(src_code)}</pre></div>\n|
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment