4

I'm writing a document using asciidoc and asciidoctor. So, I'm having a intro.adoc file and then bunch of section files. So, what I want to do is list them on to intro.adoc and add hyperlinks to them so that it will be easy to navigate.

For this I can think of two approaches:

First, I can use headers and associate a relative link to .adoc files in the same directory. So, that they will redirect to them. But I don't know how to achieve it. link: == section1.adoc[Section 1] is not working.

Second, using include::section1.adoc[]. Its working but its not a hyperlink.

What is wrong with it? or is there a easy way to do it.

Edit

If its not clear, I'm trying to achieve this # [Section1](section.md)(Markdown version) in asciidoc.

Ankit R Gadiya
  • 449
  • 1
  • 7
  • 14

1 Answers1

4

What about:

<<section1.adoc#Section1,your link>>

See: https://docs.asciidoctor.org/asciidoc/latest/macros/inter-document-xref/

Stomf
  • 177
  • 3
  • 7
Jmini
  • 9,189
  • 2
  • 55
  • 77
  • 1
    Yes the hyperlink is working but it is similar to this `link:section1.adoc[Section 1]` and what I want is that it renders as a hyperlink in Header. Thanks anyways – Ankit R Gadiya Apr 28 '17 at 10:07
  • (since the nickname tag doesn't work under the OP, I repeat my question under an answer.) @AnkitRGadiya: have you found a solution in the meantime? – saulius2 Nov 15 '22 at 09:14