On 10/12/12 04:58, Tom S wrote:
> Hi,
> 
> thank you for AsciiDoc. :)
> 
> I just wondering if it is possible to define IDs for glossary terms.
> Usually, if you want to write a glossary, you end up with this:
> 
>     [[glossary]]
> 
>     = Glossary =
>     [glossary]
> 
>     Foo::
>       This is a foo term
>     Bar::
>       This is a bar term
> 
> 
> If you use the DocBook backend, you end up with this code:
> 
>     <glossary id="glossary">
>       <title>Glossary</title>
>       <glossentry>
>         <glossterm>Foo</glossterm>
>         <glossdef>
>           <simpara>This is a foo term</simpara>
>         </glossdef>
>       </glossentry>
>       <glossentry>
>         <glossterm>Bar</glossterm>
>         <glossdef>
>           <simpara>This is a bar term</simpara>
>         </glossdef>
>       </glossentry>
>     </glossary>
> 
> 
> This works. However, I was not able to get IDs on a <glossentry>
> element. I tried this:
> 
>     [[foo_term]]
>     Foo::
>       This is a foo term
> 
> 
> This didn't work. I would have expected to get this fragment:
> 
>     <glossentry id="foo_term">
>         <glossterm>Foo</glossterm>
> 
> 
> Does anybody know a method how to do this?

This will work:

A link to the <<foo-term,Foo glossary term>>.


[glossary]
== My glossary

[glossary]
Foo::
  [[foo-term]]This is a foo term
Bar::
  This is a bar term


Note:

1. The glossary section (as well as the glossary list) must be styled as
such (with [glossary]), see
http://asciidoc.org/userguide.html#_glossary_lists

2. You need to use an inline anchor inside a list, see
http://asciidoc.org/faq.html#_how_can_i_place_an_anchor_link_target_on_a_list_item


Cheers, Stuart


> 
> 
> Thanks,
>   Tom
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "asciidoc" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/asciidoc/-/rB5MPB8NFwoJ.
> 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.

-- 
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.

Reply via email to