On Wed, Jan 08, 2025 at 06:44:43PM +0000, Gavin Smith wrote:
> Good point. Perhaps we should provide a stable customization API
> for navigation buttons only and document it well, as it seems like a fairly
> common thing that people want to customize.
I have added texinfo_register_global_direction that can be used to add
new global or text directions, but also be used to reset the node a
global direction points to. So for, example, you can do:
texinfo_register_global_direction ('Index', 'Main @emph{Index}');
If new directions are added, you also need to set the associated
direction strings, for example:
texinfo_register_global_direction('Home');
texinfo_register_direction_string_info('Home', 'text',
'<a href="https://myhomepage.example.com/">Home</a>', undef, 'normal');
texinfo_register_global_direction ('Tutorial', 'My First Program');
texinfo_register_direction_string_info ('Tutorial', 'text', 'Tutorial');
texinfo_register_direction_string_info ('Tutorial', 'button', 'Tuto');
texinfo_register_direction_string_info ('Tutorial', 'accesskey', 't');
I didn't add functions to manipulate buttons lists, as I think that it
could be done in many ways. I tried to improve the documentation on how
to do it, however, by moving some general descriptions of buttons
specifications to a chapter at the end of the document and by explaining
* how to get the default buttons lists using
Texinfo::Convert::HTML->converter_defaults(),
* how to get the direction associated to a button, and
* gave an example of modifying a buttons array.
If you want to have a look at the texi2any_api manual, the new/modified
sections are "Getting Converter Default Variables Values", "Simple
headers customizations" and in particular "Directions" and "Simple
Navigation Panel Customization".
I am satisfied with the API and documentation, but do not hesitate to
criticize!
--
Pat