Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Rackham S.AsciiDoc user guide Rev7.1.2.2006.pdf
Скачиваний:
19
Добавлен:
23.08.2013
Размер:
298.24 Кб
Скачать

AsciiDoc User Guide

Macros calls are suffixed with an attribute list. The list may be empty but it cannot be omitted. List entries are used to pass attribute values to macro markup templates.

AttributeList Element

An attribute list on a line by itself constitutes an AttributeList block element, it's function is to parameterize the following block element. The list attributes are passed to the next block element for markup template substitution.

Attribute References

An attribute references is an attribute name (possibly followed by an additional parameters) enclosed in braces. When an attribute reference is encountered it is evaluated and replaced by its corresponding text value. If the attribute is undefined the line containing the attribute is dropped.

There are three types of attribute reference: Simple, Conditional and System.

Attribute reference behavior

You can suppress attribute reference expansion by placing a backslash character immediately in front of the opening brace character.

By default attribute references are not expanded in LiteralParagraphs, ListingBlocks or LiteralBlocks.

Simple Attributes References

Simple attribute references take the form {<name>}. If the attribute name is defined its text value is substituted otherwise the line containing the reference is dropped from the output.

Conditional Attribute References

Additional parameters are used in conjunction with the attribute name to calculate a substitution value. Conditional attribute references take the following forms:

{<name>=<value>}

<value> is substituted if the attribute <name> undefined otherwise it's value is substituted. <value> can contain simple attribute references.

{<name>?<value>}

<value> is substituted if the attribute <name> is defined otherwise an empty string is substituted. <value> can contain simple attribute references.

{<name>!<value>}

<value> is substituted if the attribute <name> is undefined otherwise an empty string is substituted. <value> can contain simple attribute references.

{<name>#<value>}

57