Links to relative files by an anchor

Posted by asotobu on
URL: https://discuss.asciidoctor.org/Links-to-relative-files-by-an-anchor-tp354.html

Hi,

Today I have been thinking about one requirement that maybe could be fit un AsciiDoc format, but I think it will require some changes, or maybe I am wrong and it is already supported. I am thinking about linking to relative file, by instead of linking to section by using #<nameofsection> for example link:editing-asciidoc-with-live-preview/#livereload[LiveReload], we could do the same but to a special point without being a section.

I am thinking in next scenario:

I have got a document where I write all my Product Requirement Specifications which looks something like:

= Product Requirement Specifications

...

== Physical System Requirements

[cols="1,3"]
.Physical Requirements
|===
|PRS -1
|system should .....

|PRS-2
|system should ...
|===


But then in another document for example in Software Requirements document I want to link to an exact point of the document, for example:

= Software Requirement Specifications

...

== Persistence

* In order to meet PRS-1, we are going to use MongoDB.


The problem is that because PRS-1 is not a section I cannot do a link like:

link:prs/#PRS-1[PRS-1]

So maybe would be interesting to have a special character to enclose a word, which means that will be rendered as a link on original document so can be referenced from other document.

Maybe something like shown in AsciiDoc documentation:

 [cols="1,3"]
.Physical Requirements
|===
|anchor:PRS-1[]PRS-1
|system should .....

I have seen that in Asciidoctor you can create links to blocks with identifiers, but I have not seen if there is a way to create links to a any part of the document.