unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48334@debbugs.gnu.org, m.a.nikulin@gmail.com
Subject: bug#48334: No <title> elements in HTML manual pages
Date: Mon, 04 Jul 2022 12:42:42 +0200	[thread overview]
Message-ID: <87sfnh88gt.fsf@gnus.org> (raw)
In-Reply-To: <83o7y69w5r.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 03 Jul 2022 16:13:20 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> makeinfo is supposed to be a symlink to texi2any.

Yes, indeed.

> I made changes there because someone reported a problem with reading
> the manuals on mobile devices, because we were deleting the line with
> '<meta name="viewport"...', which in latest Texinfo takes care of
> adjusting the viewport to the width of the device display.  My changes
> were supposed to avoid deletion of this header (and a few others), but
> I don't think I kept <title>.

I tried running the code now (and commented out the
manual-html-fix-headers function), and I ended up with:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file describes the Emacs auth-source library.

Copyright (C) 2008-2022 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover Texts being "A GNU Manual,"
and with the Back-Cover Texts as in (a) below.  A copy of the license
is included in the section entitled "GNU Free Documentation License".

(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
modify this GNU manual." -->
<title>Emacs auth-source Library 0.3</title>

This is with texi2any (GNU texinfo) 6.8.  If I'm reading the code right,
the delete-region here is just deleting that <meta, the comment, and the
<title>.

It's probably different in every texinfo version, but altering the

    (search-forward "</title>\n")

to

    (search-forward "<title>")

should be safe in any case, so I'll go ahead and do that.

> Failing that, I think the only alternative is to see how the original
> Texinfo output looks in a browser, compare that with the edited
> manuals, and then decide which of the edits are really needed.  One
> problem with that is that we'll probably have to require Texinfo 6.8
> or later if we go that way, because maintaining compatibility with
> multiple Texinfo versions is really too much.  Ideally, we should keep
> the edits to the absolute minimum.

I think altering the HTML in this way isn't idea.  It'd be much better
to just parse the HTML, alter the DOM (to remove/insert elements), and
then write the DOM out to HTML again.  That'd be a whole lot less
brittle.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2022-07-04 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 14:48 bug#48334: No <title> elements in HTML manual pages Maxim Nikulin
2021-10-05 14:14 ` Maxim Nikulin
2022-07-02 16:19   ` Lars Ingebrigtsen
2022-07-02 17:02     ` Eli Zaretskii
2022-07-03 12:16       ` Lars Ingebrigtsen
2022-07-03 13:13         ` Eli Zaretskii
2022-07-03 14:48           ` Max Nikulin
2022-07-04 10:42           ` Lars Ingebrigtsen [this message]
2022-07-04 11:36             ` Eli Zaretskii
2022-07-05 11:09               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfnh88gt.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=48334@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=m.a.nikulin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).