Delta Engine Blog

All about multiplatform and game development

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