
|
How to disable '_' to '_005f' transliteration in file names?
Hi,
I'm in the process of migrating the documentation for the Autoconf
Archive to Texinfo format. In the process, I've run into a (minor)
problem and wonder whether there's a simple solution to it.
The documentation has a node per macro. These nodes are called, say
"ax_have_epoll". Now, when I use makeinfo --html to generate HTML pages,
the resulting pages are called "ax_005fhave_005fepoll.html". However,
for the sake of backwards compatibility with older versions of the web
site I'd need those files to be called "ax_have_epoll.html", i.e. I'd
like to disable the '_' to '_005f' transliteration.
Can that be done?
With kind regards,
Peter
|

|
Re: How to disable '_' to '_005f' transliteration in file names?
Hi Peter,
for the sake of backwards compatibility with older versions of the web
site I'd need those files to be called "ax_have_epoll.html", i.e. I'd
like to disable the '_' to '_005f' transliteration.
I don't recall any way to disable it in makeinfo. Patrice, is there a
way in texi2html (short of hacking the source)?
Just to mention a not-very-appealing alternative that you've probably
already thought of, you could add redirects at one level or another in
your web setup so that the old names go to the new names.
Sorry,
Karl
|

|
Re: How to disable '_' to '_005f' transliteration in file names?
On Tue, Sep 22, 2009 at 05:13:28PM -0500, Karl Berry wrote:
> Hi Peter,
>
> for the sake of backwards compatibility with older versions of the web
> site I'd need those files to be called "ax_have_epoll.html", i.e. I'd
> like to disable the '_' to '_005f' transliteration.
>
> I don't recall any way to disable it in makeinfo. Patrice, is there a
> way in texi2html (short of hacking the source)?
I think that doing an init file along the following should do the trick
(untested), and then call texi2html as
makeinfo --init-file underscore_hex_to_underscore.init
# underscore_hex_to_underscore.init
# change underscore followed by an hex number (for special character)s to a
# simple underscore
$element_file_name = \&underscore_hex_to_underscore_file_name;
sub underscore_hex_to_underscore_file_name($$$)
{
my $element = shift;
my $type = shift;
my $docu_name = shift;
my $orig_file = $element->{'file'};
if ($orig_file =~ /_[0-9a-f]{4}/)
{
$orig_file =~ s/_[0-9a-f]{4}/_/g;
return $orig_file;
}
retur nundef;
}
|

|
Re: How to disable '_' to '_005f' transliteration in file names?
Hi Patrice,
> I think that doing an init file along [1] should do the trick
> (untested), and then call texi2html as:
>
> makeinfo --init-file underscore_hex_to_underscore.init
thank you very much for this suggestion. Unfortunately, there appears to be a
misunderstanding somewhere. The makeinfo program doesn't seem to accept an
--init-file parameter. texi2html does, but texi2html use an entirely different
scheme for choosing file names, i.e. the generated files are called
autoconf-archive-<n>.html where 'n' is a sequential number. When texi2html is
run with the suggested init file, all generated files are called "nundef".
Is there a way to make texi2html generate the same HTML file names that
makeinfo would? If this were the case, I reckon that init file magic would
solve my problem.
Take care,
Peter
[1]
> # underscore_hex_to_underscore.init
> # change underscore followed by an hex number (for special character)s to a
> # simple underscore
>
> $element_file_name = \&underscore_hex_to_underscore_file_name;
>
> sub underscore_hex_to_underscore_file_name($$$)
> {
> my $element = shift;
> my $type = shift;
> my $docu_name = shift;
>
> my $orig_file = $element->{'file'};
> if ($orig_file =~ /_[0-9a-f]{4}/)
> {
> $orig_file =~ s/_[0-9a-f]{4}/_/g;
> return $orig_file;
> }
> retur nundef;
> }
|

|
Re: How to disable '_' to '_005f' transliteration in file names?
On Tue, Sep 22, 2009 at 05:13:28PM -0500, Karl Berry wrote:
> Hi Peter,
>
> I don't recall any way to disable it in makeinfo. Patrice, is there a
> way in texi2html (short of hacking the source)?
Karl transmitted your mail, I forgot to say that you need the cvs version
of texi2html to be able to call texi2html as makeinfo, and you also need
to make a link makeinfo -> texi2html.
--
Pat
|