texi2html-bug
[Top][All Lists]
Advanced

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

Re: [Texi2html-bug] Obtaining the node name in element_file_name?


From: Patrice Dumas
Subject: Re: [Texi2html-bug] Obtaining the node name in element_file_name?
Date: Mon, 28 Jul 2008 14:15:52 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jul 20, 2008 at 02:34:45PM +0200, Reinhold Kainhofer wrote:
> 
> Now, a different, probably trivial question: How can I obtain the file path 
> of 
> the input ,texi file?

Actually it is not easy since it is not exported. The basename is
exported but not the full name. I'll correct that soon.

> Some other points:
> 
> - -) In t2h_cross_manual_normal_text you use a $ascii_character_map hash and 
>                   # wild guess that should work for latin1
>                   $result .= '_' . '00' . lc(sprintf("%02x",ord($1)));
> Wouldn't it be easier to simply use 
>       my $ccode = ord($1);
>       if ( $ccode <= 0xFFFF ) {
>         $result .= sprintf("_%04x", $ccode);
>       } else {
>         $result .= sprintf("__%06x", $ccode);
>       }
> This works with all characters...

This code is only used if USE_UNICODE is false, which means that the
perl used cannot run
 require Encode;
 require Unicode::Normalize;
In that case,
 sprintf("_%04x", $ccode);
should fail.

The code used with recent perl (more recent that 5.6 or the like) is 
in sub unicode_to_protected($) and is
  $result .= '_' . lc(sprintf("%04x",ord($1)));

Though your code is interesting because currently we don't handle right 
codepoints above 0xFFFF.

> - -) You have some code to load a $texinfo_htmlxref file. Unfortunately, I 
> don't 
> see any reference to how this is created. What does this do exactly? I 
> suppose it cannot be used to determine target file names for xrefs, which we 
> need, since we put all unnumberedsubsubsec into one file?

It is part of the ref to external manual specification we devised,
mostly with Karl. But this part  of the specification never got
implemented in makeinfo and so is only here as a proof of concept in 
texi2html. The reference is on a texinfo mailing list, I can find it if
you want to.

Now for the targets for cross-manual html xrefs when you don't split
according to the specification, there is a --node-files option for
texi2html which insures that there is a file which redirects to the
right place, with something like
  <meta http-equiv="Refresh" content="2; url=node-chap1.html#node-sec1">
and as text:
  <p>The node you are looking for is at <a 
href="node-chap1.html#node-sec1">node sec1</a>.</p>

--
Pat




reply via email to

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