Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
163 posts
|
Assuming I have something like this:
\---docs +--- example-manual.adoc \---page2.adoc With the page2.adoc being something like: [source,asciidoc] ---- Second page of the user manual. [[chap2]] == Second page chapter This project does something. We just haven't decided what that is yet. ---- Now in the example-manual.adoc, I want to make a link to the page 2. According to the Links to relative files section in the writers guide. I should be able to do something like that: [source,asciidoc] ---- link:page2[Go to the second page] link:page2/#chap2[LiveReload] ---- But both solutions are not working. The only way I managed to do this, is to make the assumption that I will get HTML document, and to use something like that: [source,asciidoc] ---- link:page2.html[Go to the second page] link:page2.html#chap2[check this section] ---- Is the documentation wrong? Did I miss something? Making the assumption on the output format is in my opinion not really a good idea. The file I want to link is page2.adoc and not page2.html (which exist only after the build with the HTML backend). Having a link to the html page means, this will not work: * in a preview context like with the chrome extension * on a GitHub page when you browse the source tree => in those cases the link is really to the adoc file and not to a the html file. What is your opinion? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
163 posts
|
I just spoke with Dan Allen at the JavaLandConf.
The new way to do it goes like that: <<page2.adoc#,Smart Link to page 2>> <<page2.adoc#intro2,Smart Link to the chap2 section in an other doc>> I will try to udpate the documentation. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
126 posts
|
I tested the behavior. It works to convert the file extension ".adoc" or ".txt" to ".html"
<<page2.adoc#,Smart Link to page 2>> or <<page2.txt#,Smart Link to page 2>> both renders as a link href="page2.html" My question is why can't Asciidoctor convert the file extension with this style? link:page2.adoc[Link to page 2]
- Ted
@TedAtCIS
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
163 posts
|
Dan told me this was introduced with 1.5.0 version of Asciidoctor, because they reconized that this was needed.
The "cross references" syntax is working and the "link:" macro syntax is not working. Maybe you will find an answer in the Inter-document cross references section. The "AsciiDoc Syntax Quick Reference" already contains an example: check the "Inter-document cross references (Asciidoctor only)" example at the end of the links section of the "AsciiDoc Syntax Quick Reference" For the "AsciiDoc Writer’s Guide" check my pull request: https://github.com/asciidoctor/asciidoctor.org/pull/368 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
> I just spoke with Dan Allen at the JavaLandConf.
It was a pleasure meeting you. Thanks for saying hi and chatting about Asciidoctor things! On Thu, Mar 26, 2015 at 7:36 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote: The "cross references" syntax is working and the "link:" macro syntax is not working. The link macro syntax is really intended for fixed / static URLs, or perhaps another type of file like a json file. If you are linking to a file generated from an AsciiDoc document, the cross references is the way to go. We can continue to enhance it as new cases arise. Cheers, |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In reply to this post by Jeremie Bresson
Here's the key section of the documentation that explains this behavior: http://asciidoctor.org/docs/user-manual/#inter-document-cross-references Updates more than welcome. -Dan On Wed, Mar 25, 2015 at 11:39 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote: I just spoke with Dan Allen at the JavaLandConf. Dan Allen | http://google.com/profiles/dan.j.allen |
Free forum by Nabble | Edit this page |