This level also applies the
Some rules are pre-defined and can be used in your elements and templates.
They are gouped in different levels (see
For most of the rules, you should look at the generated XML to modify
your CSS stylesheet according to the classes used. You can start from
the
In the following descriptions, the current element refers to the element
whose hid is retrieved by the
These rules are applied in each level:
The special tag
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
If
The following rules are called base rules: they are applied on level 0 but also in some other levels. They are used for simple formatting and to use information about the current element.
The base rules defined by plugins are also added to this list, possibly redefining pre-defined rules with the same names.
Not documented yet.
is reduced to the current value of the counter associated to the given name.
The following optional attributes can be specified:
Example:
Suppose we're handling the element whose source file is
The separator of path parts is the code given under the
To illustrate, the code
will produce the following code:
which results in:
The
will produce the following path:
is reduced to
This function inserts the given pre-formatted code. It uses the
The
The
Other example: Testing whether a variable is empty to known whether to output a block or not:
This function includes the XML node referenced by the
This function is useful to avoid code duplication. It is used in this
site to show changes of a release both in the
For example, the following code will include the paragraph with id "optiondef" of element "getting_started":
This is the result:
This function will load the file
With the additional attribute
If the file attribute begins with "." or "..", that is the filename is explicitely relative, the file path is concatenated to the current element source file path.
If the file attribute is an absolute filename, then this absolute filename is used.
By default, using
At last, all additional attributes to
Here is an example. If we have the
The following code
will be reduced to
This inserts an image using an
The
Additional attributes are passed to the generated
Each keyword will be displayed using a
In these templates,
will is reduced to the list of subnodes, separated by the given
For example:
will be reduced to
This rule evaluates OCaml code. See the following
blog posts:
This will put the two given XML nodes in a two-columns layout. Note that the tag used to enclose the left and right contents is not kept, so you may use any tag you want, for example:
This level only contains two rules:
The
Since the
This function is added to the environment by the
The nodes used for sectionning can be changed, see
This is used to insert sections and subsections, with a given title. The id, if given, will be associated to the section title node.
"section" and "subsection" are the default sectionning nodes. You can specify other nodes:
When a sectionning node is reduced, a
To prevent a sectionning node having a counter associated, you can use
This level does not contain any additional rule. The only function pre-defined in this level gathers all ids of all element, so that cross-links in next levels can be verified.
This function will issue a warning when an id is defined twice in the same element.
The default rules defined in this level are the following:
This will return a link to the element specified by its hid. The hid of an element is its absolute name from the root directoty of your project. You are not forced to give the full path, but can also give only one or more of the last parts of the path, as long as it uniquely identifies an existing element.
For example, suppose you want to refer to the element defined in file
In the last two cases, an error will be raised if more than one elements
match the incomplete hid. You can provide an additional attribute
Refering to an unknown element will raise an error. If no hid is given,
A node id can also be specified, like
If no text is given for the link, the title of the element
will be used instead (or, if a node id is given, the title associated to
the node id, if any). Specifying in attributes
The
is used to refer to a block using the given
If the node matching the
So,
is equivalent to
or
But the purpose of
Here is an example of definition of a function in an element definition:
This defines a new rule
Elsewhere, this theorem can be referred to using
which will be reduced to a link with "Theorem 1" as text, if this theorem was the first defined in the article.
This rule is used to insert the XML node specified by the