On Wed, Jul 09, 2025 at 07:23:53AM +0000, Werner LEMBERG wrote:
>
> >> OK, so please document this. Looking at section `Writing a menu`
> >> in the Texinfo info file (of current git) I don't see anything
> >> about HTML output of `@menu` blocks and how it is formatted (and
> >> the description of `FORMAT_MENU` doesn't mention this either).
> >
> > In general, we do not describe how output is formatted in the manual
> > except in rare cases. It seems to me that the formatting of menu
> > comments is not something we want to document, we do not want to set
> > expectations on a way to format or another. For example, we could
> > switch to formatting menu entries with <pre>.
>
> Well, you don't have to go into details, but I as a user want to know
> whether menu descriptions are output pre-formatted in HTML mode also.
> You eventually have to find a solution that looks good both in Info
> and in HTML mode, which is an unusual combination in Texinfo.
I edited the documentation slightly. It should be covered by the
sentence, "Menu comment lines and any empty lines are kept in the output."
We currently don't say anything about horizontal whitespace preservation
(i.e. does " " display as a wider space than " "). I believe that
happens with <pre> but this could be too much detail.
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index aa8c199bd1..2c256db56d 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -2858,13 +2858,15 @@ @node Writing a Menu
@cindex Spaces, in menus
In a menu, every line that begins with an @w{@samp{* }} is a @dfn{menu
-entry}. (Note the space after the asterisk.)
+entry}. (Note the space after the asterisk.) In the example above,
+the two lines starting with @w{@samp{* }} are menu entries.
+@cindex Menu comment
A line that does not start with an @w{@samp{* }} may also appear in a
menu. Such a line is not a menu entry but rather a @dfn{menu comment}
-line that appears in the Info file. In the example above, the line
-@samp{Larger Units of Text} is such a menu comment line; the two lines
-starting with @w{@samp{* }} are menu entries.
+line. In the example above, the line @samp{Larger Units of Text}
+is a menu comment line. Menu comment lines and any empty lines are kept
+in the output.
@cindex Hierarchical documents, and menus
Technically, menus can carry you to any node, regardless of the