Writing Documentation

Documentation is written in HTML to quickly and easily write and styilze content. HTML was chosen over other formats such as Markdown and Textile as we all should already have a basic knowledge of HTML and it provides more flexibility in styling the content.

The default stylesheet covers the basic use of HTML tags where additional stylesheet classes are available to further stylize certain content. In addition, template tags exist to help author documentation content by parsing the content through PHP.

File and Directory Structure

##TODO##

Typography

HTML tags are automatically stylized through basic stylesheet definitions.

Headings

Headings are written with the standard <hX> tags, where X is a priority number from 1, the main and biggest heading, to 6, the smallest heading. Each documentation page must start with and contain only one <h1> heading level; subsequent headings must use <h2> to <h6> depending on the hierarchy level.

Headings are written as:

<h1>Main Heading</h1>

Example h1 Heading

Example h2 Heading

Example h3 Heading

Example h4 Heading

Example h5 Heading
Example h6 Heading

Each page has an automatically generated table of contents list that is built on the heading hierarchy level from <h2> onwards. Headings that should not be included in the table of contents must have a defined stylesheet class of notoc:

<h3 class="notoc">Section Heading</h3>
The current table of contents implementation will also ignore headings containing the word notoc - please avoid using this in heading titles.

Sub-Headings

Headings can contain sub-headings by wrapping the sub-heading in the main heading with the <small> tag.

Sub-Headings are written as:

<h1>Main Heading <small>Sub-Heading</small></h1>

Example h1 Heading Attached h1 Sub-Heading

Paragraphs

Paragraphs are written with the standard <p> tag. Paragraphs are not automatically created by new lines so the <p> tag must be used.

<p>This is a paragraph.</p>

Peregrephs ere-a vreettee veet zee stunderd <p> teg. Peregrephs ere-a nut ootumeteecelly creeted by noo leenes su zee <p> teg moost be-a used. Bork bork bork!

Important Paragraphs

Important paragraphs can stand out by using the lead stylesheet class:

<p class="lead">This is an important paragraph.</p>

This is an important paragraph.

New Lines

New lines are written with the standard <br /> tag.

<p>
  Line 1<br />
  Line 2<br />
  Line 3
</p>

Line 1
Line 2
Line 3

Emphasis

Smaller Text

Smaller text can be shown in the current scope with the <small> tag.

<p>This is normal sized text <small>and this text will appear smaller</small></p>

This is normal sized text and this text will appear smaller

Bold Text

Text can be emphasized in a heavier font weight with the <strong> tag.

<p>This is normal text <strong>and this text is rendered in bold</strong>.</p>

This is normal text and this text is rendered in bold.

Italic Text

Text can be emphasized in italics with the <em> tag.

<p>This is normal text <em>and this text is rendered in italics</em>.</p>

This is normal text and this text is rendered in italics.

Underline Text

Text can be underlined with the <u> tag.

<p>This is normal text <u>and this text is underlined</u>.</p>

This is normal text and this text is underlined.

Coloured Text

Text can be emphasized in colours with the following stylesheet classes:

  • muted
  • text-warning
  • text-error
  • text-info
  • text-success
<p class="muted">This text will be coloured in grey.</p>
<p class="text-warning">This text will be coloured in yellow.</p>
<p class="text-error">This text will be coloured in red.</p>
<p class="text-info">This text will be coloured in blue.</p>
<p class="text-success">This text will be coloured in green.</p>

This text will be coloured in grey.

This text will be coloured in yellow.

This text will be coloured in red.

This text will be coloured in blue.

This text will be coloured in green.

Lists

Unordered

A list of items with no priority of order is written as:

<ul>
  <li>List item 1</li>
  <li>List item 2
    <ul>
      <li>Sub list item 1</li>
      <li>Sub list item 2</li>
    </ul>
  </li>
  <li>List item 3</li>
  <li>List item 4</li>
</ul>
  • List item 1
  • List item 2
    • Sub list item 1
    • Sub list item 2
  • List item 3
  • List item 4

Ordered

A list of items in specific order is written as:

<ol>
  <li>List item 1</li>
  <li>List item 2
    <ol>
      <li>Sub list item 1</li>
      <li>Sub list item 2</li>
    </ol>
  </li>
  <li>List item 3</li>
  <li>List item 4</li>
</ol>
  1. List item 1
  2. List item 2
    1. Sub list item 1
    2. Sub list item 2
  3. List item 3
  4. List item 4

Unstyled

An unstyled list can be produced by using the unstyled stylesheet class:

<ul class="unstyled">
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
  <li>List item 4</li>
</ul>
  • List item 1
  • List item 2
  • List item 3
  • List item 4

Description

A list of terms with their associated descriptions is written as:

<dl>
  <dt>Title 1</dt>
  <dd>Description 1</dd>

  <dt>Title 2</dt>
  <dd>Description 1</dd>
  <dd>Description 2</dd>
</dl>
Title 1
Description 1
Title 2
Description 1
Description 2
Bulleted

A bulleted list of terms can be produced by using the bulleted stylesheet class:

<dl class="bulleted">
  <dt>Title 1</dt>
  <dd>Description 1</dd>

  <dt>Title 2</dt>
  <dd>Description 1</dd>
  <dd>Description 2</dd>
</dl>
Title 1
Description 1
Title 2
Description 1
Description 2
Horizontal

A horizontal list of terms can be produced by using the dl-horizontal stylesheet class:

<dl class="dl-horizontal">
  <dt>Title 1</dt>
  <dd>Description 1</dd>

  <dt>Title 2</dt>
  <dd>Description 1</dd>
  <dd>Description 2</dd>
</dl>
Title 1
Description 1
Title 2
Description 1
Description 2

Code

Formatted

Formatted code can be produced by using the {code} template tag:

{code}
<?php
  $date = date('jS F, Y', 802562400);
  echo '[' . $date . '] These tools are a set of small tight cgi binaries written in C. They perform a number of functions to allow you to implement a guestbook or any other form that needs to write information and display it to users later in about 2 minutes.';
?>
{code}
<?php
  $date = date('jS F, Y', 802562400);
  echo '[' . $date . '] These tools are a set of small tight cgi binaries written in C. They perform a number of functions to allow you to implement a guestbook or any other form that needs to write information and display it to users later in about 2 minutes.';
?>
The {code} template tag automatically escapes the code block with special characters to ensure HTML tags are displayed and not parsed.

Plain

Plain code can be written as:

<pre>
&lt;?php
  $trap = new Acme('tnt');
  $wile-&gt;setState('ready');

  while ( true ) {
    if ( $wile-&gt;hears('meepmeep') ) {
      $trap-&gt;trigger();

      return $wile-&gt;getResult();
    }

    sleep(1);
  }
?&gt;
</pre>
It is important to escape HTML tags otherwise they will be parsed and not shown.
<?php
  $trap = new Acme('tnt');
  $wile->setState('ready');

  while ( true ) {
    if ( $wile->hears('meepmeep') ) {
      $trap->trigger();

      return $wile->getResult();
    }

    sleep(1);
  }
?>

Tables

##TODO##

Images

##TODO##

Labels and Badges

##TODO##

Alerts

##TODO##

Linking to Other Pages

##TODO##

Forbidden Content

It is forbidden to use any of the following in the documentation content:

  • Inline and external javascript
  • Custom stylesheet definitions
  • Loading of external content, eg. through iframes or objects (including but not limited to external HTML, YouTube videos, flash/java objects, etc.)
  • External images
  • Short URL services