next up previous contents index
Next: .mozyrc File Up: Help Database Files Previous: Help Database Files   Contents   Index

Anchor Text

Clickable references in the HTML text have the usual form:

<a href="something">highlighted text</a>
Here, ``something'' can be a help database keyword or an ordinary URL.

One can use named anchors in help keywords. This means that the `#' symbol is holy, and should not be used in help keywords. The named anchors can appear in the !!HTML part of the help database entries in the usual HTML way, e.g.

!!KEYWORD
somekeyword
...
!!HTML
    ...
    <a name="refname">some text</a>

Then, referencing forms like ``!help somekeyword#refname'' and <a href="somekeyword#refname">blather</a> will bring up the ``somekeyword'' topic, but with ``some text'' at the top of the help window, rather than the start of the document.

There is an additional capability: `$' expansion. Words found in anchor text that begin with a dollar sign (`$') character may be replaced by either a path related to the program, the value of a variable saved in the program, or the value of an environment variable. The character that immediately follows the word can not be alphanumeric.

This replacement is handled by a callback to the application, but both Xic (and its derivatives) and WRspice support the following keywords and behavior.

$PROGROOT
This word is replaced by the full path to the program installation directory, for example
``/usr/local/xictools/xic''.
$HELP
This word is replaced by $PROGROOT/help, meaning the same directory as $PROGROOT suffixed with /help.
$EXAMPLES
This word is replaced by $PROGROOT/examples, as above.
$DOCS
This word is replaced by $PROGROOT/docs, as above.
$SCRIPTS
This word is replaced by $PROGROOT/scripts, as above.

If there is no match to these words, the word, without the dollar sign, is checked against the variable database. If a variable is set with the same name, the string value of the variable replaces the word. If there is no match, but the word without the dollar sign matches tne name of an environment variable, the value of the environment variable will replace the word. If there is no match, there is no substitution. Substitutions are evaluated recursively.

If the first character of an anchor URL is `~', the path is tilde expanded. This is done after `$' substitution. Tildes denote a user's home directory: ``~/mydir'' might expand to ``/home/yourhome/mydir'', and ``~joe/joesdir'' might expand to ``/home/joe/joesdir'', etc.

In WRspice, one can source files from anchor text in the HTML viewer, if the anchor text consists of a file name with a ``.cir'' extension. Thus, if one has a circuit file named ``mycircuit.cir'', and the HTML text in the help window contains a reference like

<a html="mycircuit.cir">click here</a>
then clicking on the ``click here'' tag will source mycircuit.cir into WRspice. Similarly, anchor references to files with a ``.raw'' extension will be loaded into WRspice (as a rawfile, i.e., a plot data file) when the anchor is clicked.


next up previous contents index
Next: .mozyrc File Up: Help Database Files Previous: Help Database Files   Contents   Index
Stephen R. Whiteley 2024-10-26