:xrefstyle: and Treeprocessor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

:xrefstyle: and Treeprocessor

marko
Hi all,

we'd like to use :xrefstyle: full option in combination with custom Treeprocessor [1], which changes the way how examples/tables are numbered. The problem is that when using this combination the numbering works fine but the references are still using the "old numbering". See the next screenshot, where caption says "Example 4.1" but reference is "Example 44":



The question is - is there anything that can be done about this, so that the reference will also start with "Example 4.1"?

Thanks ahead!

Have a nice day,
Marko

[1] https://github.com/hibernate/hibernate-asciidoctor-extensions/blob/master/src/main/java/org/hibernate/infra/asciidoctor/extensions/customnumbering/CustomNumberingProcessor.java
Reply | Threaded
Open this post in threaded view
|

Re: :xrefstyle: and Treeprocessor

mojavelinux
Administrator
Marko,

The problem is that you're updating the caption instead of the new number property on the block. If the number property is set (which is read/write), that value is used instead caption.

You can see how the xreftext for a block is resolved here:


You can see the (local) caption property is only used as a fallback now.

-Dan

p.s. I eventually want to get rid of caption as a stored property on the block because it's a total abuse of the term. The caption should only be computed, like the xreftext. However, the transition is going to be a bit painful as the legacy terminology got so deeply entrenched.

--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: :xrefstyle: and Treeprocessor

marko
Thanks Dan for such quick response. Using the @number solved the problem!

Marko