On 10 September 2011 04:32, Fabrice Flore-Thébault <[email protected]> wrote:
> Hi
>
> I just try to figure out how to do this integrate anchors only in the
> glossary section.
>
> Given a main document, including some files.
> Some of these files are part of the glossary, and used also in the text flow
> at first occurence.
>
> What i wish is
>
> - at first occurence of a word, i include the glossary in the flow of the
> text.
> - for other occurences, a crossref makes a link to the glossary entry.
>
> But if add the anchor in the glossary entry file, it won't be an unique id
> anymore!
>
> So i guess i have to create a conditional anchor in my glossary entries,
> that would only be added if we are in the glossary section.
>
> I tried following, but it's obviously not working.
>
> I am not familiar with asciidoc variables, does someone have a reference
> where i could find some help ? Or some idea how to do this ?
Hi,
Asciidoc is not a programming language and does not have variables.
The closest attributes behave like, is symbols in a functional
language, and they are effectively immutable over their lifetime and
scope. Also Asciidoc does not guarantee the order of processing the
source so it can't find the "first" occurrence, you will have to tell
it.
My suggestion would be to define your own macro that you pass the
filename and an argument that defines if this is the first time and
the macro loads the file which uses the argument attribute eg {0}.
Cheers
Lex
--
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.