Code window for websites
Question: I am the webmaster from [www.idoodler.de](http://www.idoodler.de), I started a
Raspberry Pi how to site. The site contains Python, Ruby, Shell Script…
scripts. My question: Is is there a HTML code that formats the code like in
Stackoverflow?

Like this:

    
    
    import os
    
    os.system(command)
    

it would be even better if the window can add colors to the different types of
code.

It would be very cool if someone can tell me either how to make such a HTML
view or a link to a site that explains how to achieve this. And btw I am using
Sandvox for Mac to create the website, so I am able to use Sandvox plugins
too.

Thanks David from Germany


Answer: For highlighting code in HTML you can use
[highlight.js](http://softwaremaniacs.org/soft/highlight/en/). All you have to
do is wrap your code in `<pre><code>` tags and include the JS file:

    
    
    <pre><code> some code in here </code></pre>
    

Highlight.js will then try to recognize, which language was used and apply the
highlighting accordingly.

