FrontPage 

TB Wiki

Login

DocBlocks in 'raw' format

A block in tbwiki is marked on a page with opening and closing triple-braces.

The syntax of the first word on the same line as the opening braces determines
the type of block, and how it will be interpreted by tbwiki.

Here are some block types:
 * preformatted text - use triple braces, and no name
 * named block - use triple braces and a name on the top line
 * hidden block - use triple braces and a leading '#' in the name
   * this can also be called a "comment block"
 * processor block - put the processor name after #! on the top line

== Block names ==
A block can be named, in which case a single word immediately following the
opening triple-brace, on the same line, is the block name.
Blocks may be referenced by name from other pages or using processors.

Block names are referenced with the syntax:

{{{#!YellowBox
pageName:blockName
}}}

If the block is on the same page as the processor that is working on it,
the page name may be omitted, leaving just the leading colon.

To declare a block name, use the following:
 * simple name: By default, the first word on the same line as the opening triple braces
 * processor named block: you can put the name of a block after the processor invocation line, using a colon (':') to separate them.
   * for example: #!Table:q1results - the block name would be 'q1results'
 * by block number: a number is generated for each block while the page is being parsed.  If there is no name given by the block itself, it will be assigned one consisting of '__blockn', where n is the number of the block on the page (starting with __block1 being the first block on the page.
   * It is unwise to use block numbers for static references (that is, references from one page to another where the number is in the wiki text).  This is because as someone changes the text (adds another block to a page), the number calculated by tbwiki will change - making the old number obsolete.
   * The purpose of numbered blocks is to support dynamic pages (processors with sub-actions) so they can retrieve the block information outside of normal page context.  Note that this may still result in concurrency problems.

== examples ==
simple named block
{{{
{{{MyData
<put data here>
}} }
}}}

hidden block
{{{
{{{#HyHiddenData
<this data won't display on the page>
}} }
}}}

processor
{{{
{{{#!PigLatin
This will display as pig latin!
}} }
}}}

named table block
{{{
{{{#!Table:BlockName
<table spec and data>
}} }
}}}

unnamed table block
{{{
{{{#!Table
}} }
}}}
Internally, the table code may use a table name of __block5 for that table.

See [[TestBlocks]] for some examples.

FIXTHIS - can you start a block in the middle of a line?
FIXTHIS - can you end a block in the middle of a line?



TBWiki engine 1.9.2 by Tim Bird