anchor/link to ordered list item

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

anchor/link to ordered list item

russurquhart1
Hi,

Is there a way to define an anchor/link to an ordered list item, kind of like
. item 1
[[step_2]]. item 2
. item 3
Refer to <<step_2>> for more info.
Reply | Threaded
Open this post in threaded view
|

Re: anchor/link to ordered list item

mojavelinux
Administrator
You need to put the anchor in the text of the list item.

. item 1
. [[step_2]]item 2
. item 3

Refer to <<step_2>> for more info.

It's exactly the same as <a name="step_2"></a> in HTML.

-Dan

On Wed, Feb 3, 2016 at 5:39 PM, russurquhart1 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

Is there a way to define an anchor/link to an ordered list item, kind of like
. item 1
[[step_2]]. item 2
. item 3
Refer to <<step_2>> for more info.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/anchor-link-to-ordered-list-item-tp4256.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: anchor/link to ordered list item

Jeremie Bresson
I think this should be documented:
https://github.com/asciidoctor/asciidoctor.org/pull/489
Reply | Threaded
Open this post in threaded view
|

Re: anchor/link to ordered list item

russurquhart1
This kind of does what i want, i was hoping to be able to have the step number, what ever that was, come through. Something like:

This a line of text

. The first line of text

. The second line of text

. [[link_step]]This is the third line of text

Refer to step <<link_step>> for more info.

But then when the pdf is generated, it would say,

"Refer to step 3 for more info."

Is something like this possible?
Reply | Threaded
Open this post in threaded view
|

Re: anchor/link to ordered list item

mojavelinux
Administrator

On Thu, Feb 4, 2016 at 8:06 AM, russurquhart1 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is something like this possible?

You need to use reftext, either at the location of the anchor (e.g., [[link_step,3]]) or at the location of the reference to that anchor (e.g., <<link_step,3>>). The default behavior is to show the id.

This is explained here: http://asciidoctor.org/docs/user-manual/#internal-cross-references (though that section definitely needs more work to cover the various cases more clearly).

-Dan


--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen