!! Creating page styles

A [[page style -> page://styles]] is a directory that must contain a %notice%__style.html%% file and an optional %notice%__style%% subdirectory.

The content of %notice%__style.html%% is a standard HTML file in UTF-8 encoding that contains some substitution macros. During the generation of the final page view, these macros are replaced with the page content or additional parameters described [[below -> #macros]]. For example, this is what the default style looks like:

[@
<html>
<head>
    <meta http-equiv='content-type' content='text/html; charset=utf-8'/>

    <style type="text/css">
        body, div, p, table {
            font-size:${fontsize}pt;
            font-family:$fontfamily;
        }

        img{border:none}
        $userstyle
    </style>
    $userhead
</head>

<body>
<P>$content</P>
</body>
</html>
@]

!!! [[#macros]] Substitution macros

The %notice%__style.html%% file contains special substitution macros that start with the "$" character followed by the macro name, optionally surrounded by curly braces, for example: %notice%$content%% or %notice%${content}%%. The second case is needed if the macro must be followed immediately by some text without spaces. Currently, page styles support the following substitution macros:

* %notice%$content%% - replaced with the page content.
* %notice%$fontsize%% - the font size set in the settings. Measured in points (pt).
* %notice%$fontfamily%% - the font family name set in the settings.
* %notice%$userstyle%% - additional styles that may be created during the wiki page parsing.
* %notice%$userhead%% - additional tags inside the &lt;head&gt;...&lt;/head&gt; tag that may be created during the wiki page parsing.

The %notice%__style%% subdirectory is optional. It can contain images and CSS files. However, it is not recommended to store CSS styles in this directory; it is better to place them directly in the %notice%__style.html%% file. This is primarily due to style caching when running the program under Linux. If several styles have CSS files with the same names, these files might not be updated immediately during HTML rendering when switching between such styles.

----
'''See also:'''
* page://styles