
<* This is a hsc-comment *>You can also nest such comments.
And you can comment out sections of html-source without any problems for the browser. This simply is possible because comments in the HSC-source are not written to the HTML-object.
Of course, if you need the standard comments, you can use
<!-- This is a html/sgml-comment -->as usual.
<$EXEC COMMAND="command">
An example usage would be to insert a listing of a
directory:
<$if (__SYSTEM__="AMIGA")> <$exec COMMAND="list >t:hugo.list DIRS"> <* write listing to "t:hugo.list" *> <$include FILE="t:hugo.list" SOURCE PRE> <* include directory list *> <$exec COMMAND="delete t:hugo.list QUIET"> <* remove temporary file *> <$else><$if (__SYSTEM__="UNIX")> <$exec COMMAND="ls -al >hugo.list"> <* write listing to "t:hugo.list" *> <$include FILE="hugo.list" SOURCE PRE> <* include directory list *> <$exec COMMAND="rm hugo.list"> <* remove temporary file *> <$else> <* unknown OS: abort conversion with error message *> <$message text="operating system not supported" class="fatal"> </$if></$if>And the data created by this code sequence would look like this:
inc Dir ----rwed Today 17:48:21 image Dir ----rwed Thursday 07:10:36 features Dir ----rwed Yesterday 04:10:17 macro Dir ----rwed Thursday 06:45:15 exmpl Dir ----rwed Yesterday 03:43:59 5 directories - 10 blocks usedIf the command's return code is not equal to zero, a warning message will be displayed.
<$INCLUDE FILE="filename" [SOURCE] [PRE]>If you include a file this way, it is handled as an usual hsc-file. That means, all tags and special characters are handled as before.
To include a source file, eg a C- or HTML-source so that the
tags are not interpreted but displayed, add the optional
boolean attribute SOURCE.
<$INCLUDE FILE="hugo.c" SOURCE>Now the basic special characters "<", ">" and "&" are replaced by their entities.
Note that this does not include a <PRE>-tag to render the text as it exists with the same line breaks and spaces.
To get this done, you should use the optional boolean attribute
PRE. This inserts a <PRE> before the included
data and a </PRE> afterwards.
<$INSERT what [options]>
<$INSERT TIME>using a default format.
Optionally, you can pass a format-string, that discribes the time.
As hsc just calls the ANSI-C function strftime() to
perform that task, I've included an extract of the man-pages to this
function:
Each conversion specification is replaced by the characters as follows
which are then copied into the buffer.
%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'' (the format produced by
asctime(3).
%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 (0131).
%e is replaced by the day of month as a decimal number (131); single
digits are preceded by a blank.
%H is replaced by the hour (24hour clock) as a decimal number
(0023).
%I is replaced by the hour (12hour clock) as a decimal number
(0112).
%j is replaced by the day of the year as a decimal number (001366).
%k is replaced by the hour (24hour clock) as a decimal number (023);
single digits are preceded by a blank.
%l is replaced by the hour (12hour clock) as a decimal number (112);
single digits are preceded by a blank.
%M is replaced by the minute as a decimal number (0059).
%m is replaced by the month as a decimal number (0112).
%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 (0060).
%s is replaced by the number of seconds since the Epoch, UCT (see
mktime(3)).
%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 (0053).
%W is replaced by the week number of the year (Monday as the first day
of the week) as a decimal number (0053).
%w is replaced by the weekday (Sunday as the first day of the week) as
a decimal number (06).
%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
(0099).
%Z is replaced by the time zone name.
%%
is replaced by `%'.
Example:<$INSERT TIME FORMAT="%b %d %y">inserts current date with the strange ANSI-C
__TIME__-format.
<$INSERT TEXT="hugo was here!">inserts the text "
hugo was here". Of course, this does not
make much sense.<$INSERT TEXT="..."> is suggested to be used
with attribute values. Example:
<$INSERT TEXT=<href>>inserts the value of the macro-attribute
href.
<$LET [$UPDATE] [$GLOBAL] attribute>The optional flag
$UPDATE is used to update the value of an
already existing attribute.
If you define an attribute via <$LET> inside a macro, it is of
local existence only and is removed after processing the macro. You
can suppress this with using the optional flag $GLOBAL: in
this case, the attribute exists until the end of conversion.
<$message TEXT="message text" [CLASS="class"]>
For an example, look at <$exec>.