Code Blocks

Being a developer site, we publish content with blocks of code. DevX now has an integrated syntax highlighter feature, which you should use for all blocks and snippets of code or scripts. We support several language formats, including SQL, Java, C++, Plain text, etc.. Observe the difference between plaintext and nicely highlighted SQL:

sql

Important: When inserting code blocks, make sure that your code uses spaces for indentation, not tabs. HTML does not recognize tabs. So, if your source code originally uses tabs (mine always does), you'll need to convert it to use spaces before pasting into the editor. Either four or two spaces for each indentation level is acceptable. Three is a heresy.

Using the Code Block button

Here's the more advanced method, which gives you greater control over the rendering of the code block. Note that you can also insert a code block via the previous method, and then focus the caret in the code block and click the Code button to bring up the syntaxhighlighter dialog.

devx