On Thu, Feb 20, 2025 at 07:48:45PM +0000, Gavin Smith wrote:
> On Thu, Feb 20, 2025 at 12:07:44AM +0100, Sebastian Meyer wrote:
> > For a collection of Texinfo manuals that reference each other but no other
> > manuals, `-c HTMLXREF_MODE=none` could be used for `texi2any --html` to
> > force links in the generated HTML manuals to point to the local---thus
> > same-version---HTML files rather than to a (canonical) website from a
> > (built-in) htmlxref.cnf (that possibly serves a different version of the
> > manuals).
> > 
> > Using this approach, Texinfo >= 7.2 now shows warnings of the form
> > 
> >     warning: no HTML cross-references entry found for `...'
> > 
> > which I can mute by an additional `-c CHECK_HTMLXREF=0`.
> > Should that be the default for `HTMLXREF_MODE=none` ?
> 
> Yes, I think that would make sense to make this the default.  Thanks for
> the suggestion.

I think that CHECK_HTMLXREF should be completly ignored if HTMLXREF_MODE=none,
such that there are no warnings even if CHECK_HTMLXREF=1.

> > Obviously HTMLXREF_MODE=none wouldn't work if the manuals also contained
> > truly external cross-references (e.g., to other GNU manuals). How to proceed
> > in that case? Create and switch (as needed) two htmlxref.cnf files for the
> > within-project manuals such as
> > 
> >     manualA mono ${BASEURL}/manualA.html
> >     manualB mono ${BASEURL}/manualB.html
> > 
> > and set `BASEURL = .` for the --html run or is there a more elegant
> > solution?
> > 
> > Thanks!
>  
> Well it seems that you would need to use two different htmlxref.cnf
> files for the two runs.
> 
> It is an interesting question how to specify in htmlxref.cnf that a
> local manual should be used.  Your approach of using a URL beginning with
> "." appears to work and I don't know of a better one.

It is possible to have an empty URL to achieve that effect, like

manualA mono


It is relatively recent, but should be in 7.2.  The ChangeLog entry is:
2024-08-24  Patrice Dumas  <pertu...@free.fr>

       * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for
       an empty URL prefix as it is the only way to override an entry
       appearing in a file processed later on.

       * tp/t/htmlxref.t (htmlxref_no_urlprefix_first), tp/Makefile.tres,
       tp/t/input_files/htmlxref-no_urlprefix_first.cnf, tp/Makefile.am
       (test_files): new test with htmlxref entry with an empty URL prefix
       before an entry with URL prefix.

> Incidentally, I could not find a way to completely nullify an
> htmlxref entry.  For example, if I have "@xref{Top,,,bash}" in a
> manual, then by default this is output as 'See <a data-manual="bash"
> href="https://www.gnu.org/software/bash/manual/bash.html#Top";>(bash)Top</a>',
> using the system htmlxref.cnf.  I can override this by adding an entry
> "bash mono ./bash.html" to a local 'htmlxref.cnf' file, yielding
> 'See <a data-manual="bash" href="./bash.html#Top">(bash)Top</a>' instead.

This should simply be possible with the following in a local
'htmlxref.cnf' file:

bash mono

If there is a warning in that case, I think that it is a bug.  This has
not been tested much, so it is quite possible.

-- 
Pat

Reply via email to