Welcome to the Geeks & God Static Archive. Read more »

Posting Code To G&G Website

User Rating:
4.75
Average: 4.8 (4 votes)

The new Geeks and God website supports posting code with syntax highlighting. This can be done in a number of formats and in more than a few programming languages.

The most basic syntax is to enclose your code with the <code> tag. This won't provide syntax highlighting for your code but will enclose it in a box and escape any characters that need to be escaped.

An example:

<html>
  <head>
    <title>This is my title</title>
  </head>
  <body>
    This is my body
  </body>
</html>

For PHP users we support basic syntax highlighting when the code is enclosed in <?php ?>.

An example:

<?php
$myvar
= array();
if (
$examplevar == 'test') {
 
// do something
}
?>

We now support advanced syntax highlighting in a number of languages including python, c sharp, JavaScript, and many others by enclosing the code in the [code] tag with optional parameters. For more details click here.

A basic example with no parameters:

<html>
  <head>
    <title>This is my title</title>
  </head>
  <body>
    This is my body
  </body>
</html>

A JavaScript example with line numbers (The tag looks like [code lang="javascript" linenumbers="normal"]):

  1. var test = 1234;
  2. var testFunction = function(variable1) {
  3. document.write(variable1);
  4. };

For more details click here.