Subject: Re: bug#68970: 30.0.50; Info.el: Info-url-alist should support format-sequence that encodes "Top" node as "index"

From: Mekeor Melire <[email-masked]>
Date: Wed, 07 Feb 2024 22:10:25 +0000

2024-02-07 22:18 [email-masked]:

> > Let's assume we have a manual with "Top" node as well as a node called
> > "Foo". Let's further assume the webserver is configured so that
> > example.com/Foo does not resolve to example.com/Foo.html but rather
> > results in "not found".
>
> Why would we assume a strange configuration like that?  That's not
> what happens on gnu.org, for example.  Which documentation sites that
> offer Texinfo-derived manuals have such configurations?

Yes, gnu.org does allow to omit the .html suffix.

I am working on an Emacs package that will provide more entries to
Info-url-alist. That's why I have a tentative list, as you requested, at
hand, indeed. Here's a list of entries that require a .html suffix:

    (("annotate" "bfd" "ctf-spec" "gdb" "stabs") "https://sourceware.org/gdb/current/onlinedocs/gdb/%i.html")
    (("as" "bfd" "binutils" "ld" "gprof") "https://sourceware.org/binutils/docs/%m/%i.html")
    (("cc-mode") "https://cc-mode.sourceforge.net/html-manual/%i.html")
    (("cgdb") "https://cgdb.github.io/docs/%i.html")
    (("chickadee") "https://files.dthompson.us/docs/chickadee/latest/%i.html")
    (("cuirass" "guix") "https://guix.gnu.org/%m/manual/html_node/%i.html")
    (("forge" "magit" "ghub" "transient" "magit-section" "with-editor") "https://magit.vc/manual/%m/%i.html")
    (("gnutls" "gnutls-client-server-use-case" "gnutls-crypto-layers" "gnutls-handshake-sequence" "gnutls-handshake-state" "gnutls-internals" "gnutls-layers" "gnutls-logo" "gnutls-modauth" "gnutls-x509" "pkcs11-vision") "https://gnutls.org/manual/html_node/%i.html")
    (("guile-algorithms") "https://guile-algorithms.lajszczak.dev/%i.html")
    (("guile-email") "https://guile-email.systemreboot.net/manual/dev/en/%i.html")
    (("gwl") "https://guixwl.org/manual/html_node/%i.html")
    (("haskell-mode") "https://haskell.github.io/%m/manual/latest/%i.html")
    (("haunt") "https://files.dthompson.us/docs/%m/latest/%i.html")
    (("libc") "https://sourceware.org/%m/manual/html_node/%i.html")
    (("mailutils") "https://mailutils.org/manual/html_node/%i.html")
    (("mercury" "mercury_faq" "mercury_library" "mercury_ref" "mercury_trans_guide" "mercury_user_guide") "https://mercurylang.org/information/doc-release/%m/%i.html")
    (("org") "https://orgmode.org/manual/%i.html")
    (("orgguide") "https://orgmode.org/guide/%i.html")
    (("zsh") "https://zsh.sourceforge.io/Doc/Release/%i.html")

(Note that some domains are duplicated here.)

Here's a tentative list of non-gnu.org online manual URLs that work
without .html suffix:

    (("7400-1" "7400-1-hidden" "analysis" "ckt" "clocks" "coordinate-space" "lepton-manual" "lepton-scheme" "net-attribute" "path-example" "rf_cascade" "text-layout") "https://lepton-eda.github.io/%m.html/%e")
    (("emacs-shroud") "https://www.nongnu.org/emacs-shroud/manual/html_node/%e")
    (("emacsy") "https://www.nongnu.org/emacsy/manual/html_node/%e")
    (("geiser") "https://www.nongnu.org/geiser/%e")
    (("gnutls-guile") "https://gnutls.gitlab.io/guile/manual/html_node/%e")
    (("guile-proba") "https://luis-felipe.gitlab.io/%m/manual/%e")
    (("guile-shapefile") "https://hugonikanor.github.io/guile-shapefile/%e")
    (("octave") "https://docs.octave.org/latest/%e")
    (("optionmatrix") "https://anthonybradford.github.io/optionmatrix/%e")
    (("polipo") "https://www.irif.fr/~jch/software/%m/manual/%e")
    (("sawfish") "https://sawfish.tuxfamily.org/%m.html/%e")
    (("scm" "Xlibscm" "hobbit" "slib" "r5rs") "https://people.csail.mit.edu/jaffer/%m/%e")
    (("slime") "https://slime.common-lisp.dev/doc/html/%e")

As you can see the .html-requiring-case is very common. It would be nice
if users can conveniently use a string in this case, rather than going
for a function.

> > This is why the user must choose to use example.com/%e.html as
> > URL-specification currently. But then they have the problem that the
> > "Top" node is translated to example.com/.html.
> >
> > I suggested to add another format-sequence, %i, that translates the
> > "Top" node as "index". Thus, example.com/%i.html would translate to
> > example.com/index.html in case of "Top".
>
> I understand, but the overlap in functionality between %e and %i is
> got to cause some confusion, so if there's a way to avoid that, I'd
> prefer it.  The code intentionally produces an empty string for "Top",
> and there's a good reason for it doing so.

The "good reason" is only to keep URLs a little shorter, if possible,
for ease on eyes. :)

Another idea would be to let users specify two URL-SPECs: One for the
Top-node; another for non-Top nodes.

Another idea would be to only provide one format-sequence, for sake of
simplicity, namely one that works with .html-suffix-requiring-URLs. And
use that format-sequence in the default value of Info-url-alist. The
default URLs would be a little longer then.