Main ----- Copyright Up Previous Next

Special Attributes

hsc adds some special attributes, which can be quite useful to include special data or configure the parser.

Attributes containing special data

__ANCHOR__

This attribute is defined internaly during startup and is maintained by hsc. It contains the URI of the last anchor referenced to.

For example,
    To get update, take a look at the 
    <A HREF="http://www.giga.or.at/~agi/hsc/index.html">hsc-support-page</A>
    at <STRONG><(__ANCHOR__)></STRONG>.
will be converted to
To get update, take a look at the hsc-support-page at http://www.giga.or.at/~agi/hsc/index.html.

__DEST_NAME__, __DEST_PATH, __DEST_URI__

These attributes are defined internaly during startup and are read-only. They contain the filename, the directory and the whole relative URI of the to be created html-object.

For example,
    hsc FROM people/hugo.hsc TO html:my_project/
will lead to
    attribute     | value
    --------------+----------------
    __DEST_NAME__ | "hugo.html"
    __DEST_PATH__ | "people/"
    __DEST_URI__  | "people/hugo.html"
Note that __DEST_PATH__ does not contain the whole destination-directory, but only the relative path.

__SOURCE_NAME__, __SOURCE_PATH, __SOURCE_URI__

These attributes are defined internaly during startup and are read-only. They contain the filename, the directory and the full path and filename of the hsc-source you've passed specified when invoking hsc.

For example,
    hsc FROM people/hugo.hsc TO html:my_project/
will lead to
    attribute       | value
    ----------------+----------------
    __SOURCE_NAME__ | "hugo.hsc"
    __SOURCE_PATH__ | "people/"
    __SOURCE_URI__  | "people/hugo.hsc"

__SYSTEM__

This attribute is defined internaly during startup and is read-only. It contains a value depending on the operating system hsc is running on.

    OS       | __SYSTEM__
    ---------+-----------
    AmigaOS  | AMIGA
    Unix-esh | UNIX
This for example can be useful if you are executing a shell-command during conversion. See <$exec> for details.

Attributes for configuration

__COLOR_NAMES__

This attribute is defined in hsc.prefs and can be altered to the user's needs. However, it's value is only scanned once and later changes will not be recognised by hsc.

For attributes of type COLOR, you can not only use the cryptic #rrggbb-style, but also use some predefined values. With this attribute you can declare which values hsc should know about, each separated by a vertical bar (`|').

Example: <$define __COLOR_NAMES__:string/c="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow">

This one contains all values recommended for html-0.32 and is in the hsc.prefs that came with this distribution.

__CLICK_HERE__

This attribute is defined in hsc.prefs and can be altered to the user's needs. However, it's value is only scanned once and later changes will not be recognised by hsc.

Inside an anchor tag (<A HREF="...">), the normal text is scanned for special keywords indicating a `click here'-syndrome. With this attribute you can declare these keywords , each separated by a vertical bar (`|').

Example: <$define __CLICK_HERE__:string/c="click|here">

When processing german documents, probably this one would fit better:

<$define __CLICK_HERE__:string/c="klicken|hier">

Thomas Aglassinger (agi@giga.or.at), 29-May-1996