texinfo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposal for function reference API


From: Patrice Dumas
Subject: proposal for function reference API
Date: Sun, 9 Oct 2011 16:24:28 +0200
User-agent: Mutt/1.4.2.2i

Hello,

My current view is that function references for HTML customization should
be registered through subroutines.  This avoid polluting namespaces, and
maybe could allow for some checks when registering.  This would be consistent 
with what is done for customization variables with set_conf and get_conf.

My current idea is along having 4 functions for registration.

  register_command_formatting($converter, 'command', \&my_sub);
  register_type_formatting($converter, 'type', \&my_sub);

respectively for what is today in $commands_conversion{$command} and 
$types_conversion{$command}.

  register_formatting_function($converter, 'format', \&my_sub);

would replace the variables holding function references.  For example
  $element_file_name = \&book_element_file_name;
would become 
  register_formatting_function($converter, 'element_file_name', 
                               \&book_element_file_name);

and similar for all the format_* types set near $formatting_references.

The last registration would replace what is in texi2html in @command_handler_*
and would be commands run at different stages of the output process.  The
call could be along

  register_function ($converter, 'stage',  \&my_sub, 'priority');

The priority would be optional, and could allow to determine the order of 
calls within a stage, the default being last.

The stage could be like (as in texi2html) init, setup, process, finish...


Does it look good?

-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]