bug-texinfo
[Top][All Lists]
Advanced

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

Re: Customization variables for HTML filenames like NODE_FILES


From: Patrice Dumas
Subject: Re: Customization variables for HTML filenames like NODE_FILES
Date: Mon, 22 Apr 2019 20:37:29 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Apr 16, 2019 at 12:23:02AM +0200, Patrice Dumas wrote:
> 
> I would be in favor of removing PREFIX too.  There is nothing that can
> really replace it, but the usefulness of that option is not clear, and
> the description in the documentation is very unclear.  It is used in the
> Singular style manual too, so I think that it would be better to first
> try to find another way to do the same with customization functions
> before removing it.

I tried, and it is not so obvious and actually requires to know quite a
bit about the internals of the HTML converter.

What is set is $converter->{'document_name'} and it is used for 3
things, as far as I can say:
1) if there is no node, can be used for filenames.  Not relevant here
2) for the additional files generated for about, footnotes, contents...
3) for files generated by latex2html and tex4ht (in tp/init/tex4ht.pm 
  and tp/init/latex2html.pm)

To overwrite the document_name part in files in 2), I used 
$special_element_target_file_name function that is used to customize
those file names.  I get $self->{'document_name'} and replace it by
the prefix I want to use in the file name.

For 3) I simply set $self->{'document_name'} in a handler:
texinfo_register_handler('structure', \&t2h_sing_set_document_name, '0');

So, this can be done, but there are 2 issues.  The first one
$self->{'document_name'} needs to be changed, although it should
probably be only readable by the user.  We could put it in
configuration, but then it means readding PREFIX, only with a different
name.  The second one is that $self->{'document_name'} changes value 
within the conversion, it needs to be the default value before using 
$special_element_target_file_name, such that the value can be replaced, 
and then needs to be set to the final value.  This is very fragile and
not a good interface, I think.


I am not completly sure what should be done, a possibility would be to
keep PREFIX and document it better, in particular document the link with 
the document name, and setfilename.


Actually, I think that the idea behind PREFIX is that it goes together
with SUBDIR to specify both the subdirectory and the file prefix.  This
is somewhat redundant with --output (OUTPUT), while being different at
the same time, as --output copes for different cases, as it acts as both
SUBDIR and SUBDIR+PREFIX, and is less flexible (and OUTPUT can be used
together with PREFIX, in which case it is similar with SUBDIR).

-- 
Pat



reply via email to

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