On Tue, May 27, 2025 at 08:54:39PM +0100, Gavin Smith wrote:
> 
> 'complete_node_tree_with_menus' is not an easy function to read.
> This function, as it is named (complete_node_tree_with_menus) uses
> "menu directions" to complete any gaps in node directions, but it also
> warns on any mismatches between node directions and menu directions.
> 
> What I would like to change, as a preliminary step before trying to
> find better ways of reporting on problems with the node structure,
> is to completely separate:
> 
> * Structure checking and warning code
> * Code altering the structure.

Looks good to me.  The codes are not that dependent, it just reuse a
loop.  As it is designed now, the checks must be after determining menu
directions, as you remarked, but there are no dependency the other ay
around as far as I can tell.

> It could be possible to write completely new code just checking for
> faults, which doesn't rely on "menu directions" at all.  (It may not be
> clear to the user what "menu directions" are as these are an abstraction
> created internally by texi2any.)  For example, we could record structural
> flaws that involve groups of nodes, and then output all the warnings in
> one go, rather than reporting the warnings node-by-node.

I would be more cautious about not using "menu directions".  To me menu
directions are a useful abstraction, which is not internal to texi2any,
it is a representation of the tree obtained with menus, it is a property
of the Texinfo manual.  The checks can probably be done without the menu
directions, but my feeling is that it is easier with menu directions.

-- 
Pat

Reply via email to