Main ----- Copyright Up Previous Next

What was said was never done
Don't panic, it's not really worth your while

(Blur, "Bang")

Special Tags

hsc adds several special tags to process macros, handle conditionals, include files and lots of other things.

List of special tags


Comments

You can insert a comment with
<* 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.


Conditionals

Conditionals are used to decide whether some part of the text should be processed or not. As there is a lot to tell about them, there exists a whole chapter dealing with conditionals.

Include file

Text files can be included using <$include>.

Possible attributes:

FILE:string/required
This specifies the input file to be included
SOURCE:bool
by default, include files are interpreted as normal *.hsc files. Therefor, they may defines macros or contain html tags to render the text. But it you for example want to include an exerpt of a source code, it is handy if a less-than character (``<´´) is not interpreted as an escape character, but converted to an entity.
This attribute enables such a conversion for less than, greater than and ampersand (``&´´).
PRE:bool
The included data will be enclosed inside a <PRE> ... </PRE>, and the whole section will be rendered as pre-formatted.
TEMPORARY:bool
Normally, hsc keeps track of all files included and stores the names in the project file. Later, they can be used by hscdepp to find out dependencies.
But if a file that is to be removed after the conversion ends up in the dependency list of your Makefile, it can cause trouble for make. If the attribute is enabled, the input file will not be added to the dependency list.
You should consider to enable this attribute, if invoking make returns something like
make: *** No rule to make target `hsc0x395bf7e0001.tmp', needed by `/html/hugo.html'.

Example:

<$include FILE="macro.hsc">
This can be used to include some macro definitions
<$include FILE="hugo.c" SOURCE PRE>
This is reasonable to include a source code that has been written using some programming language like Pascal, Oberon or E.

Define attributes

You can create an attribute and pass a value to it via
<$define attribute>

If you define an attribute via <$define> inside a macro, it is of local existence only and is removed after processing the macro. You can suppress this with using the attribute flag /GLOBAL: in this case, the attribute exists until the end of conversion.

You can use the flag /CONST to make the attribute read-only. That means it can't be overwritten by <$let>


Set new attribute value

You can update an attribute's value with
<$let attribute_name = new_value>

Example:

    <$define hugo:string="hugo">       <* create hugo and set to "hugo" *>
    <$let hugo=(hugo+" ist doof.")>    <* update it to "hugo ist doof." *>

Macros

Macros can used to define your own short-cuts and templates. As there is a lot to tell about this feature, there exists a whole chapter dealing with macros.

User messages

During conversion, messages might show up. But not only hsc creates messages, also the user is able to so, if for instance he wants to perform some plausibility checks of macro arguments.

Possible attributes:

TEXT:string/required
Specifies message text
CLASS:enum("note|warning|error|fatal")='note'
Specifies message class

Example:
<$message TEXT="shit happens..." CLASS="fatal">
<$message TEXT="something's wrong" CLASS="warning">


Insert expression

This tag is used to insert data of attributes and expressions.

Example:

    <$define hugo:string="hugo">       <* create hugo and set to "hugo" *>
    <(hugo+" ist doof.")>              <* insert text "hugo ist doof." *>

Don't parse section

If you created some perverted HTML source or use features hsc can't handle (which is theoretically impossible), you can keep of hsc from parsing this section by surrounding it with <| ... |>. Of course, this is a dirty hide-out and should be used only for special cases.