|
|
Language SyntaxA Meta-HTML document consists of plain text, HTML directives, and Meta-HTML statements.
The syntax of the Meta-HTML language was designed to be as similar
to HTML as possible, so as to not sacrifice readability of the total
document. All of the Meta-HTML statements are delivered as a form
of HTML A simple tag begins with an open angle bracket (<) and ends with a corresponding close angle bracket (>). The text enclosed within the brackets is called the body; it can contain assigned variables and positional arguments. A complex tag begins with what looks exactly like a simple tag, continues throughout the body of the text, and ends with the a matching closing tag. This is analogous to the use of tags within HTML. The body of a complex tag is all of the text which appears between the opening tag and the closing tag, exclusive of those tags themselves.
Here is an example of using the simple tag
<set-var foo=bar>
Here is an example of using the complex tag
<when <get-var foo>>
The value of `foo' is <get-var foo>.
</when>
Note that both the
Additionally note that ``simple'' and ``complex'' do not refer to the
complexity of the function performed; they simply refer to the syntax
used to write the form in a document. For example, the simple tag
Variables assigned in the opening (or simple) tag have the form:
name=value
This gives the variable referred to as
<with-open-database db "/phones.db" mode=<get-var db-mode>>
...
</with-open-database>
Quoting Syntax
At times, you will need to quote the expressions that you pass to
various Meta-HTML functions. You do this with double quotes
(
<if <get-var "Space Name">
<get-var "Space Name[space index]">
<set-var space-name-present=false>>
For most cases, quoting is unnecessary, because open braces are expected to match close braces, and doubles quotes are expected to come in pairs. This is the usual case. For example:
<ifeq <get-var foo[index]> <get-var bar>
<set-var array[index]=<get-var bar>-found>
<set-var array[index]=<get-var bar>-missing>>
In the above example, no quoting was required because the only whitespace which appeared in the expression was within a set of matched braces.
![]() The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox Found a bug? Send mail to bug-manual@metahtml.org |