On Thu, Aug 03, 2023 at 11:17:06PM +0100, Gavin Smith wrote: > I've changed texinfo.texi not to use explicit @menu blocks in most cases, > using the new @nodedescription command for the information that was > previously in the @menu blocks. > > However, in the Top node of this manual, and many Texinfo > manuals, there is a @detailmenu block. I believe this can be > updated/regenerated in Emacs automatically. However, I feel it would > be better to have a way for texi2any do it.
There is already code for that in Texinfo::Transformations, new_master_menu creates a detailmenu, and regenerate_master_menu regenerate the Top node master menu, replacing the first detailmenu in Top node menus or appending at the end of the Top node menu. This is used in the regenerate_master_menu tree transformation. They could be moved to Common.pm and be used in Texinfo/Convert/Plaintext.pm and/or Texinfo/Convert/Info.pm. They may also be changed not to directly modify the top node but returns a tree. -- Pat