As explained in , modules provide named functions associated to levels, and the documents are succesively modified by these functions. Additionaly, a function of a module can be associated to various levels.

The following modules are available by default: Base, Blocks.

Here is the list of default levels and their associated functions defined by these modules:

LevelFunction(s)
0 (Base), (Blocks)
30 (Base)
50 (Base)
60 (Base)
61 (Base), (Blocks)
100 (Blocks)
120 (Blocks)
150 (Blocks)
160 (Base)
500 (Base)

For most of the rules applied by module functions, you should look at the generated XML to modify your CSS stylesheet according to the classes used. You can start from the .less files in the doc/less directory of the stog sources.

The default scheme can be changed, using the levels option in the .stog/config file. This option contains a list of pairs of the following form:

("module-name", [ ("fun1", [ l1 ; l2 ; ...]) ; ("fun2", [ l3 ; l4 ; ...]) ; ... ; ])

The list is used to set the levels a function is associated to in a given module. The default scheme could be expressed with:

levels = [ ("html", [ ("base", [ 0 ; 61 ]) ; ("add-docs", [ 30 ]) ; ("toc", [ 50 ]) ; ("cut", [ 60 ]) ; ("inc", [ 160 ]) ; ("clean", [ 500 ]) ; ]) ; ("blocks", [ ("init", [ 0 ]) ; ("base", [ 61 ]) ; ("sectionning", [ 100 ]) ; ("gather-ids", [ 120 ]) ; ("doc", [ 150 ]) ; ]) ; ]

It is possible to change only the levels of some functions. In the example below, the function of module Base will not be called, (as it is associated to an empty list of levels) and the function of the same module will be associated to levels 2 and 230, while the rest of the scheme remains unchanged:

levels = [ ("html", [ ("base", [ 2 ; 230 ]) ; ("inc", [ ]) ; ]) ; ]

Each module can associate only one function to a given level: for a level and a module, the last associated function hides the previous function associated to this level, if any.

Some predefined rules are applied in various functions of the predefined modules. They are listed here.

<contents/> is the generic function to insert some contents in an included file or template. It may be available or not depending on the context.

The special tag env_ can be used to modify the environment before analysing children. For example, here we add an association between "login" and "zoggy". This will add to the environment an association between the key "login" and the function returning the one-element list ["zoggy"], which is used later in the "login" attribute:

... ... ... ]]>

Such a function cannot be created in plugins, since functions only return XML trees, not a new environment. But your functions can return XML trees containing env_ tags to modify the environment used to evaluate the returned XML trees.

If stog is launched with option --lang language, the <langswitch> function returns some code to access to pages in other languages than language.