On 10/18/20 2:48 PM, Gavin Smith wrote:
Does anybody have a good idea how links to other Texinfo
manuals could be marked in the HTML output?  At present
there is nothing to distinguish a link like

<a 
href="https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Special-Forms";>Special
 Forms</a>

from a link like

<a href="http://ctan.org/pkg/cm-super";>CM-Super</a>

There are lots of ways. For example a new class name:

   <a class="external-texinfo-manual" href="...">...</a>

If you want to list the name of manual (which might be useful
for a hover-over) you can use a new attribute:

  <a external-texinfo-manual="GNU Emacs Lisp Reference Manual" 
href="...">...</a>

Hence I'd propose using a new value for "rel": "rel='path'" maybe
to say that the file could be looked up in a search path?

You could do that, but I'd lean to one of my other suggestions.

This is assuming that the "rel" value would even be accessible to
the code in the browser.  Looking at the WebKitGTK documentation,
there doesn't seem to be an easy way to get it: e.g. the "send-request"
signal allows you to get the URL, but not the element for the link
that has been clicked on:

https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebPage.html#WebKitWebPage-send-request

The 'rel' value (or 'class' or 'external-texinfo-manual') is trivially
available in the browser.  You're talking (I think) about the API for
an embedded browser - such as a WebKitGTK API for intercepting links.
That's a different (solveable) problem.

If the embedding API allows you to define callbacks between the browser
and the embedder, you can define a 'click' event handler for the link.
The handler extracts the extra attributes from the <a> element, and then
calls a function registered by the embedding API, withing it both
the original URL and any extra information you care to.

Another idea is that on page load you rewrite the URL to something
containing a magic string - for example:
     
https://www.gnu.org/software/emacs/manual/html_mono/elisp.html?+texinfo-manual#Special-Forms

Then a link-resolver hook for your embedding API can look for this magic string.
--
        --Per Bothner
[email protected]   http://per.bothner.com/

Reply via email to