I'm trying to write a custom template in ERB for index terms, but I'm having trouble making it work.
If I run Asciidoctor without an indexterm template, the primary, secondary, tertiary, see, and see-also all work out of the box. But I can't figure out how to call any of them in my template. I would think I should be able to do something like this:
<indexterm><primary><%= attr :primary %></primary> <% if attr? :secondary %><secondary><%= attr :secondary %></secondary><% end %>
<% if attr? :tertiary %><tertiary><%= attr :tertiary %></tertiary><% end %>
<% if attr? :see %><see><%= attr :see %></see><% end %>
<% if attr? :see_also %><seealso><% attr :seealso %></seealso><% end %>
I haven't been able to find a variation of this that works. I can call attr: terms but that gives me the entire list of terms, which is not what I want.