- Use SyntaxHighlighter. The downside to this - some random language would need a separate style sheet.
- Define a body pre.code { style in the blogger template and use the <pre class="code"> in the actual source
some random piece of code I want to paste. And any language !To get the above effect you need to define two things :
- Variable
<Variable name="codefont" description="Blog Code posting Font"
type="font" default="normal normal 110% , Monospace" value="normal normal 110% , Monospace"> - The actual style definition
body pre.code { margin:1em 0.8em 1em 0.8em ; padding:1em 1em 1em 1em; line-height:1.6em; font:$codefont; border:2px dotted green; }
This can be alleviated by doing a replace in any text editor for the < and > symbols and paste the converted html to the "Edit Html" box of blogger. You could even use txt2html if you use Linux ( Am using Ubuntu ).
Hope this helps.
No comments:
Post a Comment