AutoHTML Manual

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Index & NewsWritingWebcomicsProgrammingArtworkAll ElseLinks & Mail

  1. Overview
    1. Why AutoHTML?
    2. Warnings
    3. The Story
  2. Operation
    1. Command Line
    2. List Files
    3. Parsed Commands
      1. Control Commands
      2. Insert Commands
      3. Flow Commands
      4. Variable Commands
    4. Tips & Examples
  3. Errors & Suggestions

2.3 Parsed Commands
Text from the input file will be read character by character and copied to the output file, excluding AutoHTML commands which are in the form <~COMMANDNAME ATTRIBUTES>. The following commands are supported:

2.3.1 Control Commands
<~NOPARSE>

Placing this command before any output in a file will prevent the file from being parsed except when included. This can be used to prevent things like a header file from generating superfluous output.

<~PATH DIR="dirname">

Placing this command before any output in a file will cause dirname to be appended onto the path of the output file.

<~END>

This causes the parser to close the current file. All lines succeeding this are ignored.

<~COUNTDOWN NUM="value">

A counter is set to the specified value. The counter is set at 1 whenever a file is parsed from the list file, but retains its value through <~INCLUDE> statements.

<~COUNT>

Each time a COUNT tag is found, 1 is subtracted from the counter set by <~COUNTDOWN>. When the COUNT reaches zero, the parser acts as if an <~END> command was found. If no <~COUNTDOWN> tag was set beforehand, this statement has no effect.

2.3.2 Insert Commands
<~INSERT SRC="filename">

This inserts the specified file where the <~INSERT> command is. If more than 10 INSERT statements are nested, AutoHTML will suspect an infinite loop and will terminate.

<~WRITESTRING VAR="d">

The string stored in variable d (0-9) is inserted into the line in place of the <~WRITESTRING>.

<~>

If the file being written to had its path altered by a <~PATH> tag, this will be replaced with ../ otherwise it is ignored.

2.3.3 Flow Commands
<~LINEIF COND="conditional">

The text on the line with this command is only printed if the conditional evaluates true. The following replacements are made:
+ for logical and
- for logical or
~ for logical not
Fdd for the value of Flag #dd
Once the above substitutions are made, the conditional is evaluated logically.

<~LINEELSE>

The text on this line will only display if the last <~LINEIF> evaluated false.

<~IF COND="conditional">

Behaves the same as <~LINEIF> except on false parsing is suspended until an <~ELSEIF> <~ELSE> or <~ENDIF> is found.

<~ELSEIF COND="conditional">

Behaves the same as <~IF> except it is only evaluated when the preceding <~IF> or <~IF>-<~ELSEIF> evaluated false.

<~ELSE>

The following lines are only parsed if the preceding <~IF> or <~IF>-<~ELSEIF> evaluated false.

<~ENDIF>

This line and the following lines are evaluated normally.

2.3.4 Variable Commands
<~SETFLAG FLAG="dd">
<~RESETFLAG FLAG="dd">
<~TOGGLEFLAG FLAG="dd">

These alter the state of the flags (Set makes it 1, reset 0 and toggle changes the value to its opposite). Valid flags are 00 through 99.

<~CLEARFLAGS>

This sets all flags (00-99) to zero.

<~SETSTRING VAR="d" VALUE="string">

The string variable specified by d (0-9) is set to the contents of VALUE. Special characters are escaped similar to C strings: \" produces a quotation mark, \n produces a newline, \\ produces a backslash. Any other escape sequence will be ignored.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The BEST Text Editor Ever