bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: permanent links using #fragment names


From: Per Bothner
Subject: Re: permanent links using #fragment names
Date: Sun, 9 Jan 2022 17:28:29 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

On 1/9/22 11:53, Gavin Smith wrote:
It's certainly more elegant, but we are not generating documentation
to be served as part of some large information processing service,
like Wikipedia or other websites which don't use .html extensions.
We're generating a self-contained set of files that represent one
manual, in HTML.  These files could be accessed in a variety of ways,
not just as an online service.

In other words, the output from texi2any is small, self-contained and
inanimate.  The files should be output with .html extensions and link
to each other accordingly.

Agree.  Old-style URLs without JavaScript, as well as static file: URLs, need 
to work.

Any simplification of URL's should be treated carefully and be built
on top of the bare HTML layer if at all, not compromising the
functionality of this lower layer.

What I'm suggesting is:
(1) File splitting, file names, and intra-manual links are all unchanged from 
now.
However, if enabled by an option, file names may optionally use a 
standard-compatible %-encoding.
(2) JavaScript should automatically map #NAME to FILE.html#NAME (somehow - see 
below).
(3) If enabled (by a texi2any option *and* JavaScript is enabled), the URL
displayed in the location bar (and when hovering over a link) will be the #NAME.
Note this is already the case with file: URLs, because that's the only
part of the location URL we can update due to browser security rules.
(4) Public links (from other manuals, web pages, an email responding to a 
question)
should use the #NAME form (assuming the option in (2) enabled).
(5) When the option in (2) is enabled texinfo should emit extra html so that
when JavaScript is unavailable the #NAME fragment goes somewhere sane, probably
a link in a ToC.

Okay, but if #NAME loaded a redirection page it could go to the right
place immediately.  The way you are thinking about it is that NAME is
passed to info.js which has to find where it is.  It all depends on
how the redirection pages are done.

For #NAME to load a redirection page there has to be some JavaScript involved.
For an intra-manual link there is no need to go via a redirection page:
During loading, JavaScript rewrites href="FILE.html#NAME" to "#NAME" -
but it can save the original "FILE.html#NAME" somewhere for future use.
However, when we *start* with a #NAME-style URL it's a bit trickier:
We could *assume* there is a redirection page NAME.html and load that,
and count on redirection to take us to the correct page.  However
I'm not sure how robust that is - plus it requires another round-trip.
Probably better to put an index in the top page.
--
        --Per Bothner
per@bothner.com   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]