<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The Lambwiki Manual</title><meta charset="utf-8" /><link rel="stylesheet" href="css/lambdoc.css" media="all" title="Default" /></head><body><div class="doc doc_valid"><h1 class="doc_title">The <span class="doc_caps">lambwiki</span> Manual</h1><h2 class="doc_title">Dario Teixeira</h2><h2 class="doc_title">September 2014</h2><h1 id="doc:a:1" class="doc_sec"><span>Table of Contents</span></h1><ul class="doc_toc"><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:a:2"><span class="doc_order">1</span>Paragraphs and text formatting</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:a:3"><span class="doc_order">2</span>Special characters</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:u:sec:lists"><span class="doc_order">3</span>Lists</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:a:4"><span class="doc_order">4</span>Quotations</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:u:sec:verbatim"><span class="doc_order">5</span>Verbatim blocks</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:u:sec:source"><span class="doc_order">6</span>Source-code blocks</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:u:sec:sectioning"><span class="doc_order">7</span>Sectioning</a></li><li class="doc_item doc_level0"><a class="doc_lnk" href="#doc:a:8">Appendix</a></li><li class="doc_item doc_level0"><a class="doc_lnk" href="#doc:a:9">Backmatter</a></li><li class="doc_item doc_level1"><a class="doc_lnk" href="#doc:a:10">Bibliography</a></li></ul><hr class="doc_rule" /><p class="doc_par doc_class_initial"><span class="doc_caps">lambwiki</span> is a lightweight markup language for the description of documents. It is inspired by <span class="doc_caps">markdown</span><span class="doc_cite">[<a class="doc_lnk" href="#doc:u:bib:markdown">1</a>]</span> and <span class="doc_caps">creole</span><span class="doc_cite">[<a class="doc_lnk" href="#doc:u:bib:creole">2</a>]</span>, and remains for the most part compatible with the latter. Similarly to other lightweight markup languages, <span class="doc_caps">lambwiki</span> is targeted at the description of documents consisting largely of <span class="doc_caps">utf-8</span> text, and where syntactic annotations are inspired by conventions used in email.</p><p class="doc_par"><span class="doc_caps">lambwiki</span> is part of the family of markup languages supported by the <span class="doc_caps">lambdoc</span> library<span class="doc_cite">[<a class="doc_lnk" href="#doc:u:bib:lambdoc">5</a>]</span>. However, <span class="doc_caps">lambwiki</span> supports only a limited subset of all the features available in <span class="doc_caps">lambdoc</span>. While not as powerful and flexible as a full-featured markup language like <span class="doc_caps">lambtex</span><span class="doc_cite">[<a class="doc_lnk" href="#doc:u:bib:lambtex">4</a>]</span>, the lightweight markup used by <span class="doc_caps">lambwiki</span> should be sufficient to describe most simple documents. If your document requires a richer set of semantic elements, then obviously you should consider using instead a full-fledged markup like <span class="doc_caps">lambtex</span>.</p><h1 id="doc:a:2" class="doc_sec"><span class="doc_order">1</span><span>Paragraphs and text formatting</span></h1><p class="doc_par">A <span class="doc_caps">lambwiki</span> document is composed of a sequence of blocks. Examples of blocks include paragraphs of text, quotes, and source-code listings. Blocks occupy the entire width of the page, and are vertically separated from other blocks by a small margin.</p><p class="doc_par">Paragraphs are the simplest of all blocks, being composed of just text (either plain or annotated with special formatting directives). To separate two paragraphs, you must put at least one blank line between them. However, the blank line is optional when separating a paragraph and a non-paragraph block. Moreover, linebreaks are irrelevant within the same paragraph.</p><p class="doc_par">It is possible to apply some special formatting to passages of text. This is done by enclosing the passage between special begin and end markers, which always consist of two identical characters. <a class="doc_lnk" href="#doc:u:tab:format">Tab.&#xa0;1</a> lists all the formatting options and the begin/end markers used for each. Note that in many cases the begin marker is identical to the end marker. Also, bear in mind that nesting formatting directives is not allowed.</p><div id="doc:u:tab:format" class="doc_wrapper doc_floatable doc_table"><div class="doc_tab"><div class="doc_tab_aux"><table><thead class="doc_tgroup"><tr><td class="doc_cell_c">Begin marker</td><td class="doc_cell_c">End marker</td><td class="doc_cell_l">Example</td></tr></thead><tbody class="doc_tgroup"><tr><td class="doc_cell_c"><b class="doc_bold">* *</b></td><td class="doc_cell_c"><b class="doc_bold">* *</b></td><td class="doc_cell_l">You can make some passages be <b class="doc_bold">bold</b>.</td></tr><tr><td class="doc_cell_c"><b class="doc_bold">/ /</b></td><td class="doc_cell_c"><b class="doc_bold">/ /</b></td><td class="doc_cell_l">Here's another way to <i class="doc_emph">emphasise</i> text.</td></tr><tr><td class="doc_cell_c"><b class="doc_bold">{ {</b></td><td class="doc_cell_c"><b class="doc_bold">} }</b></td><td class="doc_cell_l">You can also imitate a <code class="doc_code">typewriter</code>.</td></tr><tr><td class="doc_cell_c"><b class="doc_bold">( (</b></td><td class="doc_cell_c"><b class="doc_bold">) )</b></td><td class="doc_cell_l"><span class="doc_caps">lambwiki</span> supports text in small-caps.</td></tr><tr><td class="doc_cell_c"><b class="doc_bold">^ ^</b></td><td class="doc_cell_c"><b class="doc_bold">^ ^</b></td><td class="doc_cell_l">The 1<sup class="doc_sup">st</sup> of January has a superscript.</td></tr><tr><td class="doc_cell_c"><b class="doc_bold">_ _</b></td><td class="doc_cell_c"><b class="doc_bold">_ _</b></td><td class="doc_cell_l">H<sub class="doc_sub">2</sub>O requires a subscript.</td></tr></tbody></table></div></div><div class="doc_caption doc_caption_long"><div class="doc_caption_aux"><h1 class="doc_caption_head">Tab.&#xa0;1:</h1><p class="doc_caption_body">Text formatting annotations. Simply wrap between the begin and end markers the passage of text you wish to format. Note that in many cases the end marker is identical to the begin marker.</p></div></div></div><p class="doc_par"><span class="doc_caps">lambwiki</span> supports also hyperlinks into external resources. The general notation for hyperlinks is <span class="doc_mbox"><code class="doc_code">[[</code> <code class="doc_code"><i class="doc_emph">uri</i></code> <code class="doc_code">|</code> <code class="doc_code"><i class="doc_emph">description</i></code> <code class="doc_code">]]</code></span>, where <code class="doc_code"><i class="doc_emph">uri</i></code> is the actual resource identifier and <code class="doc_code"><i class="doc_emph">description</i></code> is the clickable hyperlink text. The latter is optional, meaning that <span class="doc_mbox"><code class="doc_code">[[</code><code class="doc_code"><i class="doc_emph">uri</i></code><code class="doc_code">]]</code></span> will also produce a hyperlink, but one using the <span class="doc_caps">uri</span> itself as description text.</p><p class="doc_par">The following source-code fragment illustrates the declaration of paragraphs in <span class="doc_caps">lambwiki</span>, text formatting commands, and the use of hyperlinks:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">Line breaks within one paragraph are not important,</code>
<code class="doc_src_line">since paragraphs are only terminated by a blank line.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">Within a paragraph you can format certain passages</code>
<code class="doc_src_line">in **bold text**, //emphasised text//,</code>
<code class="doc_src_line">{{monospaced text}}, or even in ((small caps)).</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">For the sake of completeness, it is also possible</code>
<code class="doc_src_line">to declare superscripts such as 1^^st^^ of January,</code>
<code class="doc_src_line">and subscripts such as H__2__O.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">Adding a hyperlink into the [[http://www.wikipedia.org/|Wikipedia]]</code>
<code class="doc_src_line">is easy.  Here's another one: [[http://www.wikipedia.org/]].</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">This is the corresponding output from the <span class="doc_caps">lambwiki</span> composer:</p><div class="doc_subpage"><p class="doc_par">Line breaks within one paragraph are not important, since paragraphs are only terminated by a blank line.</p><p class="doc_par">Within a paragraph you can format certain passages in <b class="doc_bold">bold text</b>, <i class="doc_emph">emphasised text</i>, <code class="doc_code">monospaced text</code>, or even in <span class="doc_caps">small caps</span>.</p><p class="doc_par">For the sake of completeness, it is also possible to declare superscripts such as 1<sup class="doc_sup">st</sup> of January, and subscripts such as H<sub class="doc_sub">2</sub>O.</p><p class="doc_par">Adding a hyperlink into the <a class="doc_lnk" href="http://www.wikipedia.org/">Wikipedia</a> is easy. Here's another one: <a class="doc_lnk" href="http://www.wikipedia.org/">http://www.wikipedia.org/</a>. </p></div><h1 id="doc:a:3" class="doc_sec"><span class="doc_order">2</span><span>Special characters</span></h1><p class="doc_par"><span class="doc_caps">lambwiki</span> allows the direct use of <span class="doc_caps">html</span> entities via the same notation used in <span class="doc_caps">html</span>. More precisely, entities are to be enclosed between the characters '<code class="doc_code">&amp;</code>' (ampersand) and '<code class="doc_code">;</code>' (semicolon), and may be specified by name or by <span class="doc_caps">unicode</span> code point in decimal or hexadecimal notation. As an example, if the <span class="doc_caps">euro</span> symbol '<code class="doc_code">€</code>' is not readily available in your keyboard, you may enter it in either of the following three manners:</p><div class="doc_tab"><div class="doc_tab_aux"><table><thead class="doc_tgroup"><tr><td class="doc_cell_c">Name</td><td class="doc_cell_c">Decimal</td><td class="doc_cell_c">Hexadecimal</td></tr></thead><tbody class="doc_tgroup"><tr><td class="doc_cell_c"><code class="doc_code">&amp;euro;</code></td><td class="doc_cell_c"><code class="doc_code">&amp;#8364;</code></td><td class="doc_cell_c"><code class="doc_code">&amp;#x20ac;</code></td></tr></tbody></table></div></div><p class="doc_par">The reader will have noted that <span class="doc_caps">lambwiki</span> must interpret the character '<code class="doc_code">&amp;</code>' (ampersand) differently, and therefore you need a workaround if you want to input an actual ampersand. In fact, there is another character that is interpreted differently by <span class="doc_caps">lambwiki</span>, and as such also requires a special escaping sequence. That character is '<code class="doc_code">\</code>' (backslash), which also happens to be the character used for escaping. Therefore, displaying a backslash or an ampersand is achieved with <code class="doc_code">\\</code> and <code class="doc_code">\&amp;</code>, respectively. Another option is of course to use the <code class="doc_code">#47</code> and <code class="doc_code">amp</code> <span class="doc_caps">html</span> entities.</p><p class="doc_par">Note that in most practical situations you can get away with inputting an ampersand directly without escaping. This is because the scanner will only interpret an ampersand as the beginning of an entity declaration if it is immediately followed by an alphabetic or numeric sequence terminated by a semicolon. If it is not, then the ampersand is interpreted as plain text.</p><p class="doc_par">Besides individual characters, there are also some multi-character sequences that are interpreted differently by <span class="doc_caps">lambwiki</span>. One example are the previously described two character markers used for text formatting. <a class="doc_lnk" href="#doc:u:tab:seq">Tab.&#xa0;2</a> lists all the other ones. Remember to use the escape character if you wish to input any of these sequences literally.</p><div id="doc:u:tab:seq" class="doc_wrapper doc_floatable doc_table"><div class="doc_tab"><div class="doc_tab_aux"><table><thead class="doc_tgroup"><tr><td class="doc_cell_c">Sequence</td><td class="doc_cell_l">Translation</td></tr></thead><tbody class="doc_tgroup"><tr><td class="doc_cell_c"><code class="doc_code">---</code></td><td class="doc_cell_l">Typographic em-dash<br class="" /> (don't use at the beginning of a line)</td></tr><tr><td class="doc_cell_c"><code class="doc_code">--</code></td><td class="doc_cell_l">Typographic en-dash<br class="" /> (don't use at the beginning of a line)</td></tr><tr><td class="doc_cell_c"><code class="doc_code">``</code></td><td class="doc_cell_l">Opening double quotes</td></tr><tr><td class="doc_cell_c"><code class="doc_code">''</code></td><td class="doc_cell_l">Closing double quotes</td></tr></tbody></table></div></div><div class="doc_caption doc_caption_long"><div class="doc_caption_aux"><h1 class="doc_caption_head">Tab.&#xa0;2:</h1><p class="doc_caption_body">Special character sequences and their <span class="doc_caps">lambwiki</span> interpretation. Remember to use the backslash for escaping if you wish to input any of these sequences verbatim. Note that using dash(es) at the start of a line is the marker for unordered lists (see <a class="doc_lnk" href="#doc:u:sec:lists">the next section</a> for details).</p></div></div></div><h1 id="doc:u:sec:lists" class="doc_sec"><span class="doc_order">3</span><span>Lists</span></h1><p class="doc_par">Lists in <span class="doc_caps">lambwiki</span> come in two varieties: ordered and unordered. The former are denoted my prefixing each list item with the character '<code class="doc_code">#</code>', whereas in the latter case the prefix is '<code class="doc_code">-</code>'. Declaring sub-lists (ie, lists within lists) is also possible: simply repeat either '<code class="doc_code">#</code>' or '<code class="doc_code">-</code>' a number of times in accordance to the depth of the sub-list. These marker characters may be indented, as long as they are the first non-whitespace character in the line.</p><p class="doc_par">Separating a list from a preceding paragraph with a blank line is not required, though it is advisable. Similarly, usage of blank lines between list items is also optional. More importantly, make sure the list depth as indicated by the number of '<code class="doc_code">#</code>' or '<code class="doc_code">-</code>' characters makes sense: the <span class="doc_caps">lambwiki</span> composer will complain if you declare at the top-level a list with depth higher than 1, or if a sub-list increases list depth by more than one unit.</p><p class="doc_par">The following sample illustrates lists in <span class="doc_caps">lambwiki</span>. Note the flexible use of blank lines and whitespace for indentation.</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">The reasons are four:</code>
<code class="doc_src_line"></code>
<code class="doc_src_line"># This is the first reason;</code>
<code class="doc_src_line"></code>
<code class="doc_src_line"># This is the second reason; it is okay</code>
<code class="doc_src_line">  to break a line within each item.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line"># The third reason has a number of sub-clauses:</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">  -- Alpha</code>
<code class="doc_src_line">  -- Beta</code>
<code class="doc_src_line">  -- Gamma</code>
<code class="doc_src_line"></code>
<code class="doc_src_line"># And here is the fourth and final reason.</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">This is the result as produced by the composer:</p><div class="doc_subpage"><p class="doc_par">The reasons are four:</p><ol class="doc_enumerate"><li class="doc_item"><p class="doc_par">This is the first reason; </p></li><li class="doc_item"><p class="doc_par">This is the second reason; it is okay to break a line within each item. </p></li><li class="doc_item"><p class="doc_par">The third reason has a number of sub-clauses: </p><ul class="doc_itemize"><li class="doc_item"><p class="doc_par">Alpha </p></li><li class="doc_item"><p class="doc_par">Beta </p></li><li class="doc_item"><p class="doc_par">Gamma </p></li></ul></li><li class="doc_item"><p class="doc_par">And here is the fourth and final reason. </p></li></ol></div><h1 id="doc:a:4" class="doc_sec"><span class="doc_order">4</span><span>Quotations</span></h1><p class="doc_par">Quotations in <span class="doc_caps">lambwiki</span> follow the email tradition of prefixing each quoted line with the character '<code class="doc_code">&gt;</code>' (the greater-than sign). Following this marker you may have a normal paragraph or a list definition, as the example below illustrates:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">This is what you said:</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">&gt; Eggs should be opened by their large end.</code>
<code class="doc_src_line">&gt; Opening them by their small end is heresy.</code>
<code class="doc_src_line">&gt; Here are three reasons why:</code>
<code class="doc_src_line">&gt;</code>
<code class="doc_src_line">&gt; # First;</code>
<code class="doc_src_line">&gt; # Second;</code>
<code class="doc_src_line">&gt; # Third.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">I beg to differ. Let me expand on why.</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">This is the result produced by the composer:</p><div class="doc_subpage"><p class="doc_par">This is what you said:</p><blockquote class="doc_quote"><p class="doc_par">Eggs should be opened by their large end. Opening them by their small end is heresy. Here are three reasons why: </p><ol class="doc_enumerate"><li class="doc_item"><p class="doc_par">First; </p></li><li class="doc_item"><p class="doc_par">Second; </p></li><li class="doc_item"><p class="doc_par">Third. </p></li></ol></blockquote><p class="doc_par">I beg to differ. Let me expand on why. </p></div><p class="doc_par">Quotations within quotations are also legal. The quotation level is indicated by the number of '<code class="doc_code">&gt;</code>' characters that prefix the line. Whitespace between the '<code class="doc_code">&gt;</code>' characters is optional. Consider thus the following <span class="doc_caps">lambwiki</span> source:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">This is your interpretation of the discussion:</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">&gt;This is what you said:</code>
<code class="doc_src_line">&gt;</code>
<code class="doc_src_line">&gt;&gt; Eggs should be opened by their large end.</code>
<code class="doc_src_line">&gt;&gt; Opening them by their small end is heresy.</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">This is the result:</p><div class="doc_subpage"><p class="doc_par">This is your interpretation of the discussion:</p><blockquote class="doc_quote"><p class="doc_par">This is what you said:</p><blockquote class="doc_quote"><p class="doc_par">Eggs should be opened by their large end. Opening them by their small end is heresy. </p></blockquote></blockquote></div><h1 id="doc:u:sec:verbatim" class="doc_sec"><span class="doc_order">5</span><span>Verbatim blocks</span></h1><p class="doc_par">A verbatim block denotes a fragment of text where linebreaks are significant and the text is to be rendered using a monospaced font. The primary application of verbatim blocks is to display <span class="doc_caps">ascii</span>-art diagrams. In <span class="doc_caps">lambwiki</span>, the beginning of a verbatim block is denoted by a line consisting entirely of the characters '<code class="doc_code">(((</code>' (plus optional extra specifiers, described below), and its termination by a line consisting only of the characters '<code class="doc_code">)))</code>'. There is no attempt at interpreting the characters inside a verbatim block; in other words, escaping is not possible, and neither is the input of <span class="doc_caps">html</span> entities using the ampersand operator.</p><p class="doc_par">Verbatim environments accept a limited form of configuration. In the same line and immediately after the begin marker you may specify one or more class name declarations, separated by commas. Each class name maps directly to <span class="doc_caps">html</span> class names, but preppended by '<code class="doc_code">doc_class_</code>' (the prefix prevents name clashes). Note that classnames must begin with a lowercase Roman letter, and may contain only lowercase Roman letters, digits, the character '-' (dash), or the character '_' (underscore).</p><p class="doc_par">For your convenience, the <span class="doc_caps">css</span> shipped with <span class="doc_caps">lambwiki</span> includes some predefined class names for use with verbatim environments. These are <code class="doc_code">mult0</code>, <code class="doc_code">mult1</code>, and so forth until <code class="doc_code">mult9</code>. The integer indicates a multiplying factor for the contents of the environment. For a factor of <span class="doc_mathinl"><math
xmlns="http://www.w3.org/1998/Math/MathML"
><mi
>x</mi
></math
></span>, the actual scaling relative to normal size is given by <span class="doc_mathinl"><math
xmlns="http://www.w3.org/1998/Math/MathML"
><msup
><msqrt
><mn
>2</mn
></msqrt
><mi
>x</mi
></msup
></math
></span>. The default factor is 0, which corresponds to normal size. One common application of this feature is to display <span class="doc_caps">unicode</span> characters as full-sized pictures. As an example, this is what the <span class="doc_caps">unicode</span> snowman (code point <span class="doc_caps">U+2603</span>) looks like with a multiplier of 7, corresponding to a font size 11.3 times larger than normal:</p><div class="doc_pre doc_class_mult7 doc_floatable"><div class="doc_pre_aux"><pre class="doc_pre_aux">☃</pre></div></div><p class="doc_par">In addition, the default <span class="doc_caps">css</span> also allows floatation specifiers to be used with verbatim blocks. Floating specifiers take the form of class names '<code class="doc_code">center</code>', '<code class="doc_code">left</code>', and '<code class="doc_code">right</code>'. They declare that the block should be displayed either centered and occupying the entire width of the page (this is the default), floating on the left, or floating on the right, respectively. Note that they map directly to <span class="doc_caps">css</span> <code class="doc_code">float</code> declarations.</p><p class="doc_par">To illustrate the use of verbatim blocks, consider the following <span class="doc_caps">lambwiki</span> source-code fragment:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">Here's a box:</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">(((</code>
<code class="doc_src_line">---------</code>
<code class="doc_src_line">|  Box  |</code>
<code class="doc_src_line">---------</code>
<code class="doc_src_line">)))</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">The result produced by the composer is shown below:</p><div class="doc_subpage"><p class="doc_par">Here's a box: </p><div class="doc_pre doc_floatable"><div class="doc_pre_aux"><pre class="doc_pre_aux">---------
|  Box  |
---------</pre></div></div></div><h1 id="doc:u:sec:source" class="doc_sec"><span class="doc_order">6</span><span>Source-code blocks</span></h1><p class="doc_par">While nothing prevents you from using the aforedescribed verbatim blocks for displaying source-code listings, <span class="doc_caps">lambwiki</span> does have a dedicated facility for this purpose, with a number of advantages. Source-code blocks are declared in much the same way as verbatim blocks, but use '<code class="doc_code">{{{</code>' and '<code class="doc_code">}}}</code>' as delimiter characters instead. Moreover, they also accept — albeit different — style configuration options.</p><p class="doc_par">Similarly to verbatim blocks, the style configuration of a source-code environment is to be placed immediately after the '<code class="doc_code">{{{</code>' sequence that signals the beginning of the block (whitespace is optional both before and after, but the configuration must be on the same line). Because multiple configuration options are allowed, these should be separated by commas. Moreover, options come in two different types. The first was already discussed in the previous section about verbatim blocks: class name declarations. The second type is a key-value declaration, whose generic form is '<code class="doc_code"><i class="doc_emph">key</i>=<i class="doc_emph">value</i></code>', for a key '<code class="doc_code"><i class="doc_emph">key</i></code>' and value '<code class="doc_code"><i class="doc_emph">value</i></code>'.</p><p class="doc_par">There are two key-value configuration options available. The most important is undoubtedly '<code class="doc_code">lang</code>', which when set with the name of a language, sets the rules for syntax highlighting. Also available is '<code class="doc_code">nums</code>', which accepts a boolean value and dictates whether line numbers should be added to the source code listing. Valid boolean values are '<code class="doc_code">true</code>', '<code class="doc_code">yes</code>' and '<code class="doc_code">on</code>' for truth value <i class="doc_emph">true</i> and '<code class="doc_code">false</code>', '<code class="doc_code">no</code>' and '<code class="doc_code">off</code>' for truth value <i class="doc_emph">false</i>. It defaults to false.</p><p class="doc_par">The obligatory example, showing an OCaml source-code fragment:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">{{{lang=caml,nums=true,zebra</code>
<code class="doc_src_line">type 'a tree =</code>
<code class="doc_src_line">    | Leaf</code>
<code class="doc_src_line">    | Node of 'a * 'a tree * 'a tree</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">let rec count = function</code>
<code class="doc_src_line">    | Leaf                     -&gt; 0</code>
<code class="doc_src_line">    | Node (node, left, right) -&gt; 1 + (count left) + (count right)</code>
<code class="doc_src_line">}}}</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">The result as produced from the composer is shown below. Note the syntax-highlighting following OCaml conventions, the zebra lines, and the display of line numbers:</p><div class="doc_class_zebra doc_src_main"><pre class="doc_src_nums">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">1</code>
<code class="doc_src_line">2</code>
<code class="doc_src_line">3</code>
<code class="doc_src_line">4</code>
<code class="doc_src_line">5</code>
<code class="doc_src_line">6</code>
<code class="doc_src_line">7</code>
<code class="doc_src_line doc_src_dummy"></code></pre><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line"><span class="doc_src_Kwd">type</span> 'a tree <span class="doc_src_Sym">=</span></code>
<code class="doc_src_line">    <span class="doc_src_Sym">|</span> <span class="doc_src_Type">Leaf</span></code>
<code class="doc_src_line">    <span class="doc_src_Sym">|</span> <span class="doc_src_Type">Node</span> <span class="doc_src_Kwd">of</span> 'a <span class="doc_src_Sym">*</span> 'a tree <span class="doc_src_Sym">*</span> 'a tree</code>
<code class="doc_src_line"></code>
<code class="doc_src_line"><span class="doc_src_Kwd">let</span> <span class="doc_src_Kwd">rec</span> count <span class="doc_src_Sym">=</span> <span class="doc_src_Kwd">function</span></code>
<code class="doc_src_line">    <span class="doc_src_Sym">|</span> <span class="doc_src_Type">Leaf</span>                     <span class="doc_src_Sym">-&gt;</span> <span class="doc_src_Num">0</span></code>
<code class="doc_src_line">    <span class="doc_src_Sym">|</span> <span class="doc_src_Type">Node</span> <span class="doc_src_Sym">(</span>node<span class="doc_src_Sym">,</span> left<span class="doc_src_Sym">,</span> right<span class="doc_src_Sym">)</span> <span class="doc_src_Sym">-&gt;</span> <span class="doc_src_Num">1</span> <span class="doc_src_Sym">+</span> <span class="doc_src_Sym">(</span>count left<span class="doc_src_Sym">)</span> <span class="doc_src_Sym">+</span> <span class="doc_src_Sym">(</span>count right<span class="doc_src_Sym">)</span></code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><h1 id="doc:u:sec:sectioning" class="doc_sec"><span class="doc_order">7</span><span>Sectioning</span></h1><p class="doc_par"><span class="doc_caps">lambwiki</span> supports up to three levels of sectioning headers, designated as <i class="doc_emph">sections</i>, <i class="doc_emph">sub-sections</i>, and <i class="doc_emph">sub-sub-sections</i>. These map directly to <span class="doc_caps">html</span>'s <code class="doc_code">h1</code>, <code class="doc_code">h2</code>, and <code class="doc_code">h3</code> elements, respectively. The declaration of a header is done by prefixing the header text with one, two, or three times the character '<code class="doc_code">=</code>', where the number of equal signs corresponds to the sectioning level. Note that whitespace between the equal sign(s) and the header text is optional, and is discarded if present.</p><p class="doc_par">Consider thus the following <span class="doc_caps">lambwiki</span> fragment:</p><div class="doc_class_boxed doc_src_main"><pre class="doc_src_code">
<code class="doc_src_line doc_src_dummy"></code>
<code class="doc_src_line">= This is a section</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">Lorem ipsum dolor sit amet.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">== This is a sub-section</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">Lorem ipsum dolor sit amet.</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">=== This is a sub-subsection</code>
<code class="doc_src_line"></code>
<code class="doc_src_line">Lorem ipsum dolor sit amet.</code>
<code class="doc_src_line doc_src_dummy"></code></pre></div><p class="doc_par">Below is the result as produced by the <span class="doc_caps">lambwiki</span> composer. Note that the numbering is automatically assigned.</p><div class="doc_subpage"><h1 id="doc:a:5" class="doc_sec"><span class="doc_order">1</span><span>This is a section</span></h1><p class="doc_par">Lorem ipsum dolor sit amet.</p><h2 id="doc:a:6" class="doc_sec"><span class="doc_order">1.1</span><span>This is a sub-section</span></h2><p class="doc_par">Lorem ipsum dolor sit amet.</p><h3 id="doc:a:7" class="doc_sec"><span class="doc_order">1.1.1</span><span>This is a sub-subsection</span></h3><p class="doc_par">Lorem ipsum dolor sit amet. </p></div><h1 id="doc:a:8" class="doc_part"><span>Appendix</span></h1><h1 id="doc:a:9" class="doc_part"><span>Backmatter</span></h1><h1 id="doc:a:10" class="doc_sec"><span>Bibliography</span></h1><ol class="doc_bibs"><li id="doc:u:bib:markdown" class="doc_bib"><span class="doc_bib_head">[1]</span><p class="doc_bib_body"><span class="doc_bib_author">John Gruber and Aaron Swartz</span><span class="doc_bib_title"><span class="doc_caps">markdown</span> homepage</span><span class="doc_bib_resource"><a class="doc_lnk" href="http://daringfireball.net/projects/markdown/">http://daringfireball.net/projects/markdown/</a></span></p></li><li id="doc:u:bib:creole" class="doc_bib"><span class="doc_bib_head">[2]</span><p class="doc_bib_body"><span class="doc_bib_author">Various</span><span class="doc_bib_title"><span class="doc_caps">creole</span> homepage</span><span class="doc_bib_resource"><a class="doc_lnk" href="http://www.wikicreole.org/">http://www.wikicreole.org/</a></span></p></li><li id="doc:u:bib:latex" class="doc_bib"><span class="doc_bib_head">[3]</span><p class="doc_bib_body"><span class="doc_bib_author">Leslie Lamport</span><span class="doc_bib_title">LaTeX: a Document Preparation System (2<sup class="doc_sup">nd</sup> edition)</span><span class="doc_bib_resource">Addison-Wesley Professional, 1994. ISBN 0-201-52983-1.</span></p></li><li id="doc:u:bib:lambtex" class="doc_bib"><span class="doc_bib_head">[4]</span><p class="doc_bib_body"><span class="doc_bib_author">Dario Teixeira</span><span class="doc_bib_title"><span class="doc_caps">lambtex</span> manual</span><span class="doc_bib_resource"><a class="doc_lnk" href="http://lambdoc.forge.ocamlcore.org/">http://lambdoc.forge.ocamlcore.org/</a></span></p></li><li id="doc:u:bib:lambdoc" class="doc_bib"><span class="doc_bib_head">[5]</span><p class="doc_bib_body"><span class="doc_bib_author">Dario Teixeira</span><span class="doc_bib_title"><span class="doc_caps">lambdoc</span> homepage</span><span class="doc_bib_resource"><a class="doc_lnk" href="http://lambdoc.forge.ocamlcore.org/">http://lambdoc.forge.ocamlcore.org/</a></span></p></li></ol></div></body></html>