Re: configuration and namespaces

Dumas Patrice <[email protected]> Tue, 24 Jun 2003 13:25:19 +0200
Newsgroups gmane.comp.tex.texi2html.devel
Message-ID <[email protected]>
> >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. 
> >
> 
> What exactly is the extent of the LaTeX2HTML support?  I scanned the 
> docs and the perl but it wasn't quickly obvious.  I don't recall 
> encountering it as a step in the Texi2HTML conversion...  is it a 
> seperate feature?

It works well. Most of the related functions and such are prefixed with 
l2h. To have it work, you have to call texi2html with -l2h, and it won't 
give usefull results unless you also provide -expand tex.

> Hrm.  Dependant on your answer to my last question, and perhaps whether 
> it would be posible to extract the LaTeX stuff and bind the two modules 
> less tightly, what about Texi2HTML::LaTeX2HTML or LaTeX2HTML namespaces 
> (and Texi2HTML::LaTeX2HTML::Config/LaTeX2HTML::Config)?

I agree. And I also believe that the functions should also be separated.

> I think I prefer the Texi2html::Config namespace, since it simplifies 
> the Config.pm file, but this requires that warnings be suppressed during 
> the require since, if defaults are provided for everything, then a 
> redefinition warning will be issued for at least the functions.  strict 

This issue is allready handled, with things like

$t2h_print_thing = \&t2h_default_print_thing;

sub t2h_default_print_thing($)
{
...
}

When redefining subroutines the user can give them any name he wants.
I believe it would also work if we used anonymous subroutines in the 
way you suggested.

> compilation may need to be suppressed for the duration of the require as 
> well.

If I'm not wrong, my experiments seem to show that this happens allready, 
as when a new file is required, the strict is suppressed.

Pat