Delta Engine Blog

AI, Robotics, multiplatform game development and Strict programming language

Posting code on this blog

A few little tricks on how to blog code or any text files for that matter (.txt, .xml, .cs, .cpp, etc.):

You can use the Code Style from the Editor, but that code will just be monofont and handle the spacing, newlines and tabs if you paste it into the non-html editor.

A better way, but sadly incompatible with the non-html editor is to use the following tags (must be done in raw html mode and you should do it when all the rest of the text is written):


<pre class="brush: csharp">

or use


<pre class="brush: xml">

for xml, etc.

When you are done with your code block, just close it with


</pre>



To post images in the upper right corner like I always do, just upload an image, go to html mode and copy it to the very start of the blog post and add style="float:right" to the img tag!

References:

  • Other brush names:
Bash/shellbash, shell
C#c-sharp, csharp
C++cpp, c
CSScss
Delphidelphi, pas, pascal
Diffdiff, patch
Groovygroovy
JavaScriptjs, jscript, javascript
Javajava
JavaFXjfx, javafx
Perlperl, pl
PHPphp
Plain Textplain, text
PowerShellps, powershell
Pythonpy, python
Rubyrails, ror, ruby
Scalascala
SQLsql
Visual Basicvb, vbnet
XMLxml, xhtml, xslt, html, xhtml

Comments (6) -

  • SEO

    2/12/2010 12:13:24 PM |

    Top post. I look forward to reading more. Cheers

  • bamboo floors

    2/12/2010 1:38:08 PM |

    Really appreciate this post. It’s hard to sort the good from the bad sometimes, but I think you’ve nailed it!

  • bookkeeper

    2/23/2010 9:49:16 AM |

    Nice job, it’s a great post. The info is good to know!

  • bookkeepers

    3/2/2010 11:51:32 AM |

    Top post. I look forward to reading more. Cheers

Comments are closed