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

HSC.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,
    For updates, take a look at the 
    <A HREF="http://www.giga.or.at/~agi/hsc/index.html">hsc-support-page</A>
    at <STRONG><(HSC.ANCHOR)></STRONG>.
will be converted to
For updates, take a look at the hsc-support-page at http://www.giga.or.at/~agi/hsc/index.html.

HSC.DOCUMENT.NAME, HSC.DOCUMENT.PATH, HSC.DOCUMENT.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
    ------------------+----------------
    HSC.DOCUMENT.NAME | "hugo.html"
    HSC.DOCUMENT.PATH | "people/"
    HSC.DOCUMENT.URI  | "people/hugo.html"
Note that HSC.DOCUMENT.PATH does not contain the whole destination-directory, but only the relative path.

HSC.EXEC.RESULT

This attribute contains the return-code of the command invoked using <$exec>. It is updated after every call of this hsc-tag.

HSC.LF

This attribute contains a single linefeed-character (``\n´´) and can be used to include linefeeds into attribute-values without hsc whining about them.

HSC.SOURCE.NAME, HSC.SOURCE.PATH, HSC.SOURCE.FILE

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
    ----------------+----------------
    HSC.SOURCE.NAME | "hugo.hsc"
    HSC.SOURCE.PATH | "people/"
    HSC.SOURCE.FILE | "people/hugo.hsc"

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      | HSC.SYSTEM
    --------+-----------
    AmigaOS | AMIGA
    Unixoid | UNIX
This can be useful if you are executing a shell-command during conversion. See <$exec> for an example how to include a listing of the current directory, working with more then only a specific OS.

HSC.TMP.*

For several tasks, hsc declares it's own temporary attributes for internal use. Most of them can't even be refered to by you. The only reason why I list them here is, that some of them might show up in messages.

For example, if you are using the special tag <(...)> (insert expression), hsc creates an attribute HSC.TMP.insert.expression to assign the value of the expression you passed between the brakets. If this expression now is corrupt, you will achive a message mentioning the attribute HSC.TMP.insert.expression.

Attributes for configuration

HSC.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 HSC.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.

HSC.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 HSC.CLICK-HERE:string/c="click|here">

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

<$define HSC.CLICK-HERE:string/c="klicken|hier">

HSC.FORMAT.FILESIZE

This attribute contains a template that descibes how the result of GetFileSize() should be rendered. Conversion specifications:
    %b    is replaced by the filesize in bytes.
    %k    is replaced by the filesize in kilo-bytes.
    %m    is replaced by the filesize in mega-bytes.
    %g    is replaced by the filesize in giga-bytes.
    %a    is replaced by the filesize, with a reasonable unit computed automatically
    %u    is replaced by the unit for %a
This attribute is defined internaly during startup, and contains the value "%a%u", leading to results like "123K" or "12M". It can be changed by the user at any time.

HSC.FORMAT.TIME

This attribute contains a template that descibes how the result of GetTime() and GetGMTime() should be rendered. Conversion specifications (Techn. Note: These are the same as for ANSI-C's strftime()):
    %A    is replaced by the full weekday name.
    %a    is replaced by the abbreviated weekday name, where the abbreviation
           is the first three characters.
    %B    is replaced by the full month name.
    %b or %h
           is replaced by the abbreviated month name, where the abbreviation
           is the first three characters.
    %C    is equivalent to ``%a %b %e %H:%M:%S %Y´´
    %c    is equivalent to ``%m/%d/%y´´.
    %D    is replaced by the date in the format ``mm/dd/yy´´.
    %d    is replaced by the day of the month as a decimal number (01­31).
    %e    is replaced by the day of month as a decimal number (1­31); single
           digits are preceded by a blank.
    %H    is replaced by the hour (24­hour clock) as a decimal number
           (00­23).
    %I    is replaced by the hour (12­hour clock) as a decimal number
           (01­12).
    %j    is replaced by the day of the year as a decimal number (001­366).
    %k    is replaced by the hour (24­hour clock) as a decimal number (0­23);
           single digits are preceded by a blank.
    %l    is replaced by the hour (12­hour clock) as a decimal number (1­12);
           single digits are preceded by a blank.
    %M    is replaced by the minute as a decimal number (00­59).
    %m    is replaced by the month as a decimal number (01­12).
    %n    is replaced by a newline.
    %p    is replaced by either ``AM´´ or ``PM´´ as appropriate.
    %R    is equivalent to ``%H:%M´´
    %r    is equivalent to ``%I:%M:%S %p´´.
    %t    is replaced by a tab.
    %S    is replaced by the second as a decimal number (00­60).
    %s    is replaced by the number of seconds since the Epoch, UCT.
    %T or %X    
           is equivalent to ``%H:%M:%S´´.
    %U    is replaced by the week number of the year (Sunday as the first day
           of the week) as a decimal number (00­53).
    %W    is replaced by the week number of the year (Monday as the first day
           of the week) as a decimal number (00­53).
    %w    is replaced by the weekday (Sunday as the first day of the week) as
           a decimal number (0­6).
    %x    is equivalent to ``%m/%d/%y %H:%M:%S´´.
    %Y    is replaced by the year with century as a decimal number.
    %y    is replaced by the year without century as a decimal number
           (00­99).
    %Z    is replaced by the time zone name.
    %%    is replaced by ``%´´.
This attribute is defined internaly during startup, and contains the value ``%d-%b-%Y, %H:%M´´, leading to results like "04-Dec-1996, 02:49".

Thomas Aglassinger (agi@giga.or.at), 04-Dec-1996