Dǝve Derıso

Step 1. Open your tumblr customize window to Theme

Step 2. Enable custom HTML

Step 3. In between </head> and <body> paste the following code:

<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script> 
<script src='http://www.undermyhat.org/blog/wp-content/uploads/2009/09/shBrushMatlabSimple.js type='text/javascript'></script>
<script language='javascript'> 
SyntaxHighlighter.config.bloggerMode = false;SyntaxHighlighter.config.stripBrs = true;SyntaxHighlighter.defaults['wrap-lines'] = false;SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';SyntaxHighlighter.all();
</script>

Step 4. Get some code, and replace all of the ‘<’ symbols with ‘&lt;’ and all of the ‘>’ symbols with ‘&gt;’ (i use find and replace through notepad, textedit, or vim…)

Step 5. Once your code is properly formatted, create a post, click on HTML and paste the following

<pre class="brush: js">   
function supFoo()
{
	window.write('&lt;p&gt; Hello World! &lt;/p&gt;)
}
</pre>

The above will come out like:

function supFoo()
{
	window.write('<p> Hello World! </p>')
}

Step 6. Paste your formatted code as indicated above

IMPORTANT: The first time you post your code, everything will show up fine. But, for some reason, when you try to edit the post from the dashboard, all of your code will be massively spaced out. So, my remedy is to do all of my editing in textedit and then paste when im done. If you know how to fix this, please drop me a line :)

Thanks to Alex Gorbatchev! For more info, go here

UPDATE: I NO LONGER USE THIS!!

It slows you page way the heck down. Over it. I now use the lightweight google prettify. Cheers!

  1. syina303 reblogged this from deriso
  2. deriso posted this
Designed By Dave Deriso © 2010