configuration and namespaces
Dumas Patrice <[email protected]> Wed, 18 Jun 2003 14:19:09 +0200
| Newsgroups | gmane.comp.tex.texi2html.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
It seems to me that we are about to rework the configuration model of
texi2html. Thus I will put here some proposals/questions:
namespaces
----------
Currently there is one module, called T2H_i18n, for internationalization.
Derek suggested to use another, Texi2HTML. And, if we use variables and
not a hash, use another sub module Texi2HTML::Config. In any case I think
that T2H_i18n should better be called Texi2HTML::I18n.
What do you think about it ?
things currently in the init file
---------------------------------
Currently the things which should be in Texi2HTML::Config are in variables
(strings, arrays, hashes and function references).
There are variables like
T2H_DEBUG
function references like
$T2H_print_section
and
$t2h_index
and things taken from texi2html.pl, like
%accent_map
There are also global variables which are used by the functions, but set
in texi2html.pl:
The hashes
T2H_HREF, T2H_NAME, T2H_NODE, T2H_NO_TEXI
and the refs
$T2H_OVERVIEW
$T2H_TOC
$T2H_TOP
$T2H_THIS_SECTION
$T2H_THIS_HEADER
And lastly there are variables for LaTeX2HTML
put Latex2html variables in another file
----------------------------------------
First I think that the variables for LaTeX2HTML should go in a distinct file.
And there will be a switch (and variable) for that file.
This is still problematic if we want to distribute texi2html as a single file
and still override the latex2html defaults, we have to keep those variables
global... At least they shouldn't be mixed with Texi2html config variables
anymore.
A hash or variables
-------------------
There are 2 possibilities, here:
- use a hash, %config, in the Texi2HTML namespace and put all the above
things in it. In that case I suggest removing the T2H_ or t2h_. The
variables will be called
$Texi2HTML::config{'DEBUG'}
instead of
$T2H_DEBUG
And in that case we could require the config files while in the Texi2html
name space and the entries in the init file would be like
$config{'DEBUG'} = 1;
- use a submodule Config and keep the variables as is, removing T2H_ or t2h_.
The variables will be called
$Texi2HTML::config::DEBUG
And in that case we could require the config files while in the
Texi2html::Config name space and the entries in the init file would be like
$DEBUG = 1;
What do you prefer ?
global variables used in .init functions
----------------------------------------
I also suggest putting the global variables used in the init file functions
in the Texi2HTML namespace. Thus, for example
%T2H_HREF would become %Texi2HTML::HREF
Pat