Download Autoduck Tags - Literate Programming

Transcript
semicolon typed at the beginning of the line.
Format Strings
Format strings consist of literal output text mixed with special entries that reference fields
from the Autoduck tags. In any format-string entry in the formatting file, the format string
begins with the first non-blank character following the equal sign of the entry and ends with
the first entry, section, or comment found following the formatting entry.
For example, the following entry defines a format string that outputs the text "Field 1:"
followed by the contents of field 1 of a tag:
.format= Field 1: $1
The following special elements can be present in a format string:
$$
Specifies a dollar sign ($) character.
##
Specifies a number (#) character.
$[name]
Specifies a diagram name defined in the [DIAGRAM] section of the formatting file. The
diagram is output in place of the $[name] code.
$[index:topic_tag_expr:extr_flag_expr]
Specifies an index to output. By default, all topic names processed in the build are output
in the index. By adding the :topic_tag_expr and/or :extr_flag_expr, you can specify a
subset of topics using a specified tag name or residing under a specified combination of
extraction flags. For information on tag or flag expressions, see “Extraction Expressions”.
$(name)
Specifies a string constant name defined in the [CONSTANT] section or passed to
Autoduck via the /D command-line argument. The constant string is output in place of the
$(name) code.
$n
Specifies a reference to field number n from within the tag. The contents of field number n
are output in place of the $n code. If the source paragraph was identified as an example
paragraph in the [PARAGRAPH] section, the field text is output in example style.
Field numbers start with 1 and end with the count of fields in the tag.
$tagname.n
Specifies a reference to field number n from within tag tagname. Autoduck searches the
topic's tag list for a tag matching tagname. If no matching tag is found, nothing is output.
Field numbers start with 1 and end with the count of fields in the topic tag.
#n
Specifies a reference to field number n from within the tag. The contents of field number n
are output as a WinHelp/Viewer context string; any non-compliant characters are
converted to underscores (_).
If the field contains a substring enclosed in angle brackets (e.g., TemplateFunc<class b>),
Autoduck strips the substring (including brackets) from the context string.
$!d
Outputs the current date.