Login  Register

Portable, rendering-agnostic link? #2

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

Portable, rendering-agnostic link? #2

ChrLipp
I am using asciidoctor-gradle-plugin in version 0.7. Since 0.7 is not working on Windows (and 0.6 is not working anyway) and I need Asciidoctor 0.1.4 I am running asciidoctor on a colleagues Mac.

I need Asciidoctor 0.1.4 for portable, rendering-agnostic links, but the feature is not working for me.
I was following the discussions
- Portable, rendering-agnostic link? (see http://discuss.asciidoctor.org/Portable-rendering-agnostic-link-td422.html)
- Re: Link versus XRef (see http://discuss.asciidoctor.org/Re-Link-versus-XRef-td327.html)
and the issue
- Enhance the link macro to support linking to a relative AsciiDoc document (https://github.com/asciidoctor/asciidoctor/issues/417)

Given:
link:other-document.adoc[text]

When rendered as HTML, I would expect:
<a href="other-document.html">text</a>

However, it is:
<a href="other-document.adoc">text</a>

So the question is:

- do I have to activate the feature or
- did I misunderstand the forum discussion and the issue and I have to use a different approach for linking or
- is this feature still not working

Kind regards, Christian
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Portable, rendering-agnostic link? #2

mojavelinux
Administrator
Christian,

We decided to build this feature into the xref instead of the link macro. Thus, what you are looking for is inter-document xrefs. Check out the linked section in the user manual and let us know if you still have questions about how to use it.

http://asciidoctor.org/docs/user-manual/#inter-document-references

The short answer to your question is:

<<other-document#,text>>

which produces:

<a href="other-document.html">text</a>

The trailing hash in the xref means "link to top". To link to a section in that doc, you would use:

<<other-document#section-id,text>>

which produces:

<a href="other-document.html#section-id">text</a>

Cheers,

-Dan


On Tue, Oct 29, 2013 at 8:48 AM, ChrLipp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I am using asciidoctor-gradle-plugin in version 0.7. Since 0.7 is not working on Windows (and 0.6 is not working anyway) and I need Asciidoctor 0.1.4 I am running asciidoctor on a colleagues Mac.

I need Asciidoctor 0.1.4 for portable, rendering-agnostic links, but the feature is not working for me.
I was following the discussions
- Portable, rendering-agnostic link? (see http://discuss.asciidoctor.org/Portable-rendering-agnostic-link-td422.html)
- Re: Link versus XRef (see http://discuss.asciidoctor.org/Re-Link-versus-XRef-td327.html)
and the issue
- Enhance the link macro to support linking to a relative AsciiDoc document (https://github.com/asciidoctor/asciidoctor/issues/417)

Given:
link:other-document.adoc[text]

When rendered as HTML, I would expect:
<a href="other-document.html">text</a>

However, it is:
<a href="other-document.adoc">text</a>

So the question is:

- do I have to activate the feature or
- did I misunderstand the forum discussion and the issue and I have to use a different approach for linking or
- is this feature still not working

Kind regards, Christian



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



--