- Submit your code to an external form which converts to HTML for you, which you then plug into your blog post.
- Do some simple layout editing and alter color and fonts settings to get a generic code box.
Currently I'm using the second option. There's a couple of things that are undesirable about the second option. Firstly, it does not do syntax highlighting. Secondly, it parses html-like content as html. Since it's a code box, we don't want that to happen. I feel that before I move on to the third option, I should outline how to use the second. If you're okay with it's faults, then read on.
Firstly, you'll want to edit the layout of your blog, and choose to edit the HTML. Now, following the instructions here, add the following code to your layout.
Under the variable definition section, put this:
<Variable name="codeBGColor" description="Code Box Background Color" type="color" default="#ffffff" value="#ffffee">
<Variable name="codeBorderColor" description="Code Box Border Color" type="color" default="#000000" value="#612e00">
<Variable name="codeTextColor" description="Code Box Text Color" type="color" default="#000000" value="#440000">
<Variable name="codeFont" description="Code Box Font" type="font" default="normal normal 100% monospace" value="normal normal 90% monospace">
And then, under the css section, put this:
border: 1px dashed $codeBorderColor;
Then, save, and make sure there are no errors.
When you want a section of code in your blog post, all you have to do is wrap the code in an element and give it the "code" class. I suggest...
"<pre class='code'>Your code here.</pre>".
And there you have it! Your own easy generic code class.