Re: Create cross-reference to section number
Posted by
mojavelinux on
Jan 22, 2021; 12:50am
URL: https://discuss.asciidoctor.org/Create-cross-reference-to-section-number-tp8451p8452.html
On Thu, Jan 21, 2021 at 5:41 PM apj68 [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Hi, asciiDoctors. . . Here's my ailment: I'm trying to create a troubleshooting outline something like this:
= Troubleshooting Widgets
:sectnum:
:sectnumlevels: 5
:!section-refsig:
// 1.0
[[iswidget]]
== Is there a widget?
=== Great! Go to <<iswunning>>.
// 2.0
[[iswunning]]
== Is this the widget wunning?
=== No, too bad, go to <<wonky>>
=== Yes, great!
// 3.0
[[wonky]]
== Is widget wonky?
=== Yes, too bad!
=== No, great!
Hopefully you get the idea. I would like to use short reference signifiers so that this appears like this:
1.0 Is there a widget?
1.1 Great! Go to 2.0.
2.0 Is this the widget wunning?
2.1 No, too bad, go to 3.0.
2.2 Yes, great!
3.0 Is widget wonky?
3.1 Yes, too bad!
3.2 No, great!
But, as far as I can understand it, to reference the automation section number I'd have to link to <<is_widget_wonky?>>. This would be hard because that level of document could be a pretty complicated phrase/question.
I'd rather not put a custom anchor and reftext because then I would have to constantly update the section numbers as the document changed.
Can anyone suggest any ideas?
Thanks!
Andy
--