On 11/04/12 08:01, David Priest wrote:
In this bit of the conf file:[indexterm-inlinemacro] # Index term. # fix unnecessary repetition of terms # Primary only. {2%}<indexterm><primary>{1}</primary></indexterm> # Primary and secondary. {2#}{3%}<indexterm><primary>{1}</primary><secondary>{2}</secondary></indexterm> # Primary, secondary and tertiary. {3#}<indexterm><primary>{1}</primary><secondary>{2}</secondary><tertiary>{3}</tertiary></indexterm>What do the {2%} {2#} {3%} {3#} symbols at the start of the line signify? I've spent several hours looking for an explanation in the user guide, google groups, and source code... can't puzzle it out.
They are conditional attribute references (http://www.methods.co.nz/asciidoc/userguide.html#_conditional_attribute_references) For example, {2%} is an instance of the {<names>%<value>} conditional attribute reference. In this case the attribute<name> is '2' (the second positional attribute, see http://www.methods.co.nz/asciidoc/userguide.html#X21) and the <value> is a blank string which means the attribute reference is replaced by a blank string if the '2' attribute is not defined otherwise the containing line is dropped. The '#" conditional attribute drops the containing line if the attribute<name> is undefined, it substitutes the<value> if it is defined. One thing that can be puzzling is that the indexterm inline macro has both the standard indexterm:[<attrlist>] syntax and the less noisy (((<attrlist>))) syntax (see http://www.methods.co.nz/asciidoc/userguide.html#_indexes). Cheers, Stuart
Thanks!
-- You received this message because you are subscribed to the Google Groups "asciidoc" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/asciidoc?hl=en.
