Templates are simple ASCII files containing only comments and macro definitions. Comment is any text that is outside any macro definition. It is recommended to write a quote at the beginning of each comment line. Macro language is case sensitive.

Macro definition has two forms. Every macro name is embedded between two "$" characters e.g. $this-is-macro-name$. If macro name is used inside any macro definition it is treated as an expansion of macro with specified name.

Macro definition starts with a macro name which must be at the beginning of the line. If the macro name does NOT start with "$vbdoc-" string, its definition continues only on that line.

The following defines a macro whose value is ".html".

Example

$MEMBER-EXT$ .html

If the macro name starts with "$vbdoc-" string (thus complete name is "$vbdoc-rest"), its definition is all the following text until the first occurrence of "$end-vbdoc-rest" string which also must be at the beginning of the line.

Example

$vbdoc-description$

Creates HTML Help (*.chm) file which looks like MSDN Visual Basic Reference.

Links in related topics are displayed as pop-up dialogs. Temporary HTML files

are also created and can be edited later. Then they can be compiled by hhc.exe 

program located in $VBDOC-PATH$\Templates directory.

$end-vbdoc-description$

Macro body can contain any ASCII text or expansion of another macro by simple inserting its name. In the previous example, the macro expansion is marked with red color. Whenever the $vbdoc-description$ macro is expanded, its body replaces macro call and all macro expansions (calls) inside its body are expanded as well.

System takes every occurrence of "$" character in any macro body as a start of a macro call. There must be also terminating "$" character, otherwise an error occurs. If there is a macro call to an undefined macro, nothing is expanded and that macro call is supposed to be normal ASCII text. If you want to use "$" character in the macro, you must write it twice: "$$". Then the system knows that it is not macro call and replaces it with one "$".

Example

$price$ 10

$vbdoc-sentence$

The price for the taxi is $$$price$

$end-vbdoc-sentence$

Result of expanding $vbdoc-sentence$ macro is "The price for the taxi is $10".

User can define his own macros but some macros are fixed and provided by VSdocman:

1.Read-only macros, their values are set by VSdocman during compilation.

2.Compulsory macros that must be defined by user in a template because VSdocman uses them while compiling.

3.Commands that are used to make loops and conditions.

The best way to learn how to use them is to read predefined template files (*.vbdt) in VSdocman\Templates folder.

See Also