Home · All Classes · Grouped Classes · Annotated · Functions

Help Browser Preprocessor

Introduction

The Help Browser includes a preprocessor that allows a single source of html help files from which device-specific help can be extracted for presentation to the user. This allows packages to be distributed with on-line help that adapts to the user's actual device.

Syntax

The supported syntax is a subset of Server Side Includes. This syntax was chosen so that the documentation can alternatively be served by a web browser.

Flow Control

SSI if-else-endif can be used (but not elif), with the expression being a set of variable references separated by "||". Variables that are non-empty are "true" and variables that are empty (or not defined) are "false".

    <!--#if expr="$PHONE || $TOUCH"-->
    ...
    <!--#else-->
    ...
    <!--#endif-->

The following variables are pre-defined (or not) for Qtopia Documentation:

Additionally, the Helpbrowser pre-loads "device.html" before each page. It contains variable device-specific variable settings.

Variable Substitution

The string

    <!--#echo var="MYVAR"-->

is replaced with the value of the variable MYVAR.

The syntax for setting a variable is:

    <!--#set var="MYVAR" value="some text"-->

It is usually useful to define variables inside configuration blocks. Like this:

    <!--#if expr="$PHONE"-->
     <!--#set var="YOURDEV" value="your phone"-->
    <!--#else-->
     <!--#if expr="$PDA"-->
      <!--#set var="YOURDEV" value="the PDA"-->
     <!--#else-->
      <!--#set var="YOURDEV" value="the device"-->
     <!--#endif-->
    <!--#endif-->
    ...
    Do not wash <!--#echo var="YOURDEV"-->!

File Inclusion

The string

    <!--#include file="FILENAME"-->

is replaced with the contents of the file FILENAME, which is recursively processed in the manner described here.

One use for this is device-specific documentation. The Qtopia help attempts to put anything that might vary between devices into a device-specific file. These files all start with "device-". By replacing these files, the Qtopia help can document a different device.

Examples

    <!--#if expr="$PDA"-->
    Stuff for the PDA
    <!--#endif-->
    <!--#if expr="$PDA || $TOUCH"-->
    Stuff for the PDA or Touchscreen Phone
    <!--#if expr="$PDA"-->
    Here's some PDA specific stuff in the middle
    <!--#endif-->
    Here's some more PDA/Touchscreen stuff
    <!--#endif-->
    <!--#if expr="$PHONE"-->
    Stuff for any Phone
    <!--#if expr="$KEYPAD"-->
    Stuff for a Keypad Phone
    <!--#endif-->
    <!--#endif-->
    <!--#include file="device-colors.html"-->
    Press the <!--#echo var="color-offswitch"--> button to turn off the device.


Copyright © 2007 Trolltech Trademarks
Qtopia 4.3.0