create_section and references

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

create_section and references

dalai
Hi,

I am creating a section in my macro using the create_section function and providing a custom id. The section is created without problems, it is also correctly numbered and I can create working cross references using the id.

What I am trying to figure out, is how to create a reference to a section using its number, e.g. "Section 1.2" (asciidoctor-pdf with xrefstyle short). If I don't supply a reftext, I get just the id in brackets. I've also noticed that I get a warning about a possible invalid reference, even when the cross reference comes after the section.

Any pointers?
Reply | Threaded
Open this post in threaded view
|

Re: create_section and references

dalai
I think this is a bug, the ref is not being registered in the create_section function. Adding

doc.register :refs, [id, sect]

to the extensions.rb fixes it for me. I opened a ticket: https://github.com/asciidoctor/asciidoctor/issues/3822