Re: automatic generation of @menu entries

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <YUKVttMbac7CRUdf@vapier>
On 13 Sep 2021 10:37, Patrice Dumas wrote:
> On Sun, Sep 12, 2021 at 03:09:30PM -0400, Mike Frysinger wrote:
> > based on the manual description, it sounds like the tree structure is
> > accessible already since that's how the @contents are generated, and
> > it's able to output that just fine.  so i (naively) assume that adding
> > an automatic menu would be comparable.
> 
> As I said in another mail, it is already the case, in Info output a menu
> is automatically added if there is none.  Also now, in the default case,
> in HTML output the sectioning commands are used for directions, not
> menus (default is 'sectiontoc' for FORMAT_MENU).
> 
> > > It would also mean the produced menu items will lack the short
> > > descriptions, which are produced by a human typing them in Texinfo.
> > 
> > right, that's why i suggested a new @menudesc to retain that part 
> 
> I do not think that it is very relevant to add a separate @-command for
> that.  My understanding of the @menu use-case is to allow to have
> a control on the formatting of the menu for the Info format, to have
> a menu that looks good in plain text, with control on spacing in
> particular.  Having a separate @menudesc command would be more in line
> with the semantic nature of the Texinfo language, but would see little
> use, as, my feeling is that descriptions are not really useful if not
> part of a menu.
> 
> > (if
> > the existing @unnumberedsec and such are insufficient).
> 
> Node names are used in menus, not sectioning commands names.  There is
> a TREE_TRANSFORMATIONS, insert_nodes_for_sectioning_commands, that uses
> sectioning commands to setup nodes automatically using sectioning
> commands names, but it is not the default setting.  With
> @xrefautomaticsectiontitle and other customization variables
> it is possible to use more section names, but in general it is not the
> default.

tbh, if @menu is only for info pages, i'm not super invested in them.  i only
use html & pdf sources personally.  i was just trying to DTRT, and the existing
GNU projects use them, and the texinfo manual says to define them.  if texinfo
generates stub ones for me, i'll just delete my curated ones and move on.

that said, i'll note that in my testing, @menu is being generated for chapter
nodes with sections, but it's not being generated for the Top node.  i tried:
$ makeinfo -I doc --no-split -I doc -I ../../../sim/doc -o doc/sim.info ../../../sim/doc/sim.texi \
    -c 'TREE_TRANSFORMATIONS=complete_tree_nodes_menus,regenerate_master_menu'
-mike
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmFClbYACgkQQWM7n+g3
9YGBtQ//VhIr0ssPVREWJ0TJCSFxjz4/AB5jOgUVSaKyBX6r9u+6aESvcuhPKnP6
rTpzyyFMXPX2P2BThjUcgE1Uskk5hKBmzZJhjQgyQWVI6G18nCsOLu/VSOueZdV6
2k/BRxmx0r0s48vqUoWRtS1IyTn7HDIuHlJGAu7lwnHk2T54cYwGG76mh0loCX9m
QqT5LOLIoZjrmVzvKbToG11Z5sqxls2WEYBdRecwpKS4P39lIf/4HYU7n/uiFPTL
ZpvPc9e7xjjdZhS8xhgezrHoaav5DgAw8ITwiunE9Z4mrUusGXDCvCx3jhyDKDsl
GTRS4COCoBd/qw70AKDi/pQEE9vMkcO3FAa2QUcbxGwRBegL57tckaIN1gp2azTC
+Hz11dfV/lOGFkCuzcCyK2OsGQxRpjwYOeWfD7BJsyfDIfop8AXtJGm4IKgOXuMA
xjkSelFl/QQyRCXQMOfljQ6+Bq7BHtZIjSgVk+E0Q7h2wwrL6c5UMWXGBcbUMqDs
0ajvTTpHrKn/1wCXcO2y0GImAKWiGq2UEN7T9cdxHu2mSwCOvX4V+0n5NXcl5/Ug
Jk3y0IYjhfl+8/c8Q3ajRmFYFKUylBQ9D8mjibg0cZ9ERiJIGj/8fMlihF1gRL4b
inj9lL/xiW4Zzd9j6JZtzfWNVROYPKn5UR6QV2OxKmAdH0vtlLA=
=nK6N
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.