Anchors between documents and HTML with search bar

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

Anchors between documents and HTML with search bar

Kervyn
I have come across two issues. I have quite a big file, which consists of chapters, and I can create a beautiful PDF from it. The master file, document.adoc  looks like this:

(...)
:sectlinks:
:idprefix:
:idseparator: -

= Title

toc::[]

include::chapter1.adoc[]
include::chapter2.adoc[]
(...)

I have come across two issues which I cannot handle despite a lot of Google-Fu:

1. I want to have a link in chapter1, which redirects the user to a specific fragment (anchor) in chapter2 (I believe this is called inter-document cross reference). I saw this topic, but following the included example project didn't work out for me. When generating either a PDF or a HTML version of the document, the link still redirects to e.g. chapter2.pdf#anchor (non-existing file), and not to document.pdf#anchor . I would like this to also work in multiple pages HTML output, which leads me to the second question...

2. ...what is the best and simplest way to transform these .adoc files to a simple multiple pages HTML with a working search bar? What tools should I use and in what order, is there a way to do this from this master document.adoc file?
Reply | Threaded
Open this post in threaded view
|

Re: Anchors between documents and HTML with search bar

Kervyn
Does anyone know how to handle these? I am kind of stuck and can't move on with HTML version.
Reply | Threaded
Open this post in threaded view
|

Re: Anchors between documents and HTML with search bar

David Jencks
I am admittedly quite biased, I tend to think that Antora is the answer to everything :-)

If you have a multi-page site I would seriously consider if Antora is suitable.  Antora definitely handles xrefs to other-page-fragments correctly.

I’ve adapted asciidoctor-web-pdf to Antora and currently it can, roughly speaking, transform an Antora nav file into a pdf document, changing the links to (semantic) includes.  This solves the problems with links you mentioned.  However, this is experimental.  antora-pdf

I actually thought from reading the documentation that asciidoctor-pdf supported links-to-included-page-fragments, but I haven’t been able to locate the code that does this, and have no actual experience with trying to do it. 



On Sep 14, 2020, at 5:02 AM, Kervyn [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Does anyone know how to handle these? I am kind of stuck and can't move on with HTML version.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Anchors-between-documents-and-HTML-with-search-bar-tp8214p8254.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML