help-texinfo
[Top][All Lists]
Advanced

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

Re: [help-texinfo] texi2html Questions


From: Joel Sherrill
Subject: Re: [help-texinfo] texi2html Questions
Date: Fri, 2 Dec 2011 09:36:26 -0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20110927 Thunderbird/7.0

On 11/30/2011 03:31 PM, Patrice Dumas wrote:
On Tue, Nov 29, 2011 at 04:39:54PM -0600, Joel Sherrill wrote:
Hi,

I am ashamed to admit that the RTEMS project
(http://www.rtems.org) is still using texi2www.
Anyone else remember that?
I didn't knew it, but the last release was some years
before I became involved in texi2html...
I feel old when I look at the copyright and see:

Copyright (C) 1994, 1995, 1996 Tim Singletary

The initial commit to our repository was was in 1998 and it
was version "texi2www-960103". <sigh>

it is definitely a dinosaur. :(
+ What should we be using? With texi2html folding
into texinfo, is this just a packaging issue or will
a new command replace texi2html?  I would hate to get
moved up to texi2html only to be days away from it
being obsolete.
It is obsolete, but a lot of what was in texi2html is now
in one form or another in texinfo and will be in the
next release.  The API changed, however and is still not
final and will only be finalized after the release.
And based on our few changes to texi2www, our main
changes to it were to help compatability with texi2html.

+ texi2www had a "library" navigation button which
could take you out of a document to a list of documents
for the project.  Is there an equivalent for this in
texi2html? I don't want to override all the buttons,
just add one.
This is possible, but it is a bit involved, not really
intuitive, and not documented.

Here is the perl code that you could put in an init file:

texinfo_register_handler('setup', \&add_button);

my $button_text = '<a href="../dir.html">Directory</a>';
sub add_button($)
{
   my $self = shift;
   foreach my $button_type ('SECTION_BUTTONS', 'CHAPTER_BUTTONS',
                            'MISC_BUTTONS', 'TOP_BUTTONS') {
     my $buttons = $self->get_conf($button_type);
     push @$buttons, \$button_text;
   }
   return 1;
}
I am glad to hear you think this isn't obvious. :)

I added that to an init file.  Invoked texi2html as follows

texi2html -D use-html -I . -I .. -I .. --init-file=texi_init --split node --menu c_user.texi

And got this error:

error loading .//texi_init: Undefined subroutine &Texi2HTML::Config::texinfo_register_handler called at .//texi_init line 1.

+ texi2www had a -header and -footer argument that
took a filename to include in the output
html.  I think EXTRA_HEAD or  AFTER_BODY_OPEN is what I
am looking for. But I have no idea if these are the right
variables and how one goes about setting them.
It is AFTER_BODY_OPEN.  And for the footer it is PRE_BODY_CLOSE.

You can either pass the text to the command line, but it is quite
ugly:

./texi2any.pl --verbose  --html c.texi --init exm.init  --set=AFTER_BODY_OPEN='<A 
HREF="http://www.rtems.com";  target="Text Frame">
<IMG align=right BORDER=0 SRC="../images/rtems_logo.jpg" ALT="RTEMS
Logo">   </A>
<H1>RTEMS @VERSION@ On-Line Library</H1>
'
Hmm... is texi2any.pl the issue?  Is that part of the new texinfo?
I am using the texi2html that shipped with Fedora 15

$ rpm -qf /usr/bin/texi2dvi
texinfo-tex-4.13a-15.fc15.i686
$ rpm -qf /usr/bin/texi2html
texi2html-1.82-6.fc15.noarch

Any suggestions on making this work with that texi2html until
the new texinfo is out.
Or you can set it in an init file like

set_from_init_file ('AFTER_BODY_OPEN',
'<A HREF="http://www.rtems.com";  target="Text Frame">
<IMG align=right BORDER=0 SRC="../images/rtems_logo.jpg" ALT="RTEMS
Logo">   </A>
<H1>RTEMS @VERSION@ On-Line Library</H1>
');


I would definitely prefer the init file approach.  It pushes less into
Makefiles and getting quotes right can be more challenging there.

Thanks.  I really want to get in the mainstream.  The newer tools
are certainly more capable and consistent across the output
formats. I am hoping to remove some of our conditional magic. :)

--
Joel Sherrill, Ph.D.             Director of Research&  Development
address@hidden        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


Attachment: texi_init
Description: Text document


reply via email to

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