Reputation: 3545
I am the webmaster from 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
Upvotes: 0
Views: 2565
Reputation: 74076
For highlighting code in HTML you can use highlight.js. 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.
Upvotes: 3