Inter-document xref using full URLs

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

Inter-document xref using full URLs

wolandscat
Sometimes (for us, all the time), document A wants to reference a related document B, but there is no simple relationship between the directory location of the adoc sources of the target, and the final URL where we post it.

So we need to use the URL of document B rather than some relative location that will get turned into a URL. We also do this a lot, so we could in theory convert those root URLs to variables and include them.

I tried this (inline version for illustration):

[source, asciidoctor]
----
:openehr_am_adl14: http://www.openehr.org/releases/AM/latest/ADL1.4.html

See <<{openehr_am_adl14}#_placeholder_constraints, Placeholder constraints>> in the ADL specification for a fuller explanation.
----

The result I get is this - a working link, but wrong text subsitution:



I looked at a few issues including 844, but can't find anything on this. Should it work? What's the right way to do it? Probably a normal link, i.e.

[source, asciidoctor]
----
See {openehr_am_adl14}#_placeholder_constraints[Placeholder constraints] in the ADL specification for a fuller explanation.
----

This does work. If this is the correct solution, my 'issue' here is to do with how this is documented - functionally what is going on here is a kind of inter-document xref, so I think it should be documented in that section of the manual, which it sort of is right now, but only to say 'don't do this' because it's not coupled to the HTML output. To get around that, you'd probably need something really smart to do with substitutable extensions where the extension of any target URL gets changed to the kind of document currently being generated ... but then, what if the PDF doc wants to reference an HTML doc?

I see no 100% clean solution. For now, we are just using HTML output, so we'll duck the problem of what to do for PDF generation, and it may never be a big issue.

thoughts?

- thomas