lilypond-devel
[Top][All Lists]
Advanced

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

Re: remove duplicate anchor generation in texi2html


From: Patrick McCarty
Subject: Re: remove duplicate anchor generation in texi2html
Date: Tue, 29 Dec 2009 21:43:58 -0800
User-agent: Mutt/1.5.20 (2009-06-14)

On 2009-12-29, Patrick McCarty wrote:
> On Mon, Dec 28, 2009 at 2:26 PM, Graham Percival
> <address@hidden> wrote:
> > The below patch stops texi2html from creating two anchors, making the
> > webpage navigation much more comfortable.  However, it also makes the
> > TOC navbars disappear.
> >
> > diff --git a/Documentation/lilypond-texi2html.init 
> > b/Documentation/lilypond-texi
> > index 1ff5d8a..2ca1a67 100644
> > --- a/Documentation/lilypond-texi2html.init
> > +++ b/Documentation/lilypond-texi2html.init
> > @@ -733,7 +733,10 @@ sub lilypond_element_target_name($$$)
> >   # TODO: Once texi2html correctly prints out the target and not the id for
> >   #       the sections, change this back to ($id, $target)
> >   $target = lc($target);
> > -  return ($target, $target);
> > +
> > +# removes duplicate anchor generation
> > +  return ($target, "");
> > +#  return ($target, $target);
> >  }
> 
> The HTML for the second-layer TOC is missing after applying this
> patch, so the CSS is not broken, just the HTML.  div#tocframe is still
> generated, but only for the top-level TOC.
> 
> Also, it's only an accident that this would make the webpage
> navigation more comfortable, since the real solution is to remove the
> anchors from the hyperlink URLs when the texinfo is split by section
> (I'm working on it).  With this patch, the hyperlink anchors point to
> a non-existent anchors; while harmless, it's still annoying.  :-)

After an hour digging through the texi2html source, I was not able to
figure it out, so I'll come back this issue in a couple of days.

Though, as an experiment, I tried nulling the first return value
instead of the second, and the second-layer TOC did not disappear.  I
don't know if this causes problems elsewhere though.  See the diff
below.

Thanks,
Patrick


diff --git a/Documentation/lilypond-texi2html.init 
b/Documentation/lilypond-texi2html.init
index 1ff5d8a..2906347 100644
--- a/Documentation/lilypond-texi2html.init
+++ b/Documentation/lilypond-texi2html.init
@@ -733,7 +733,10 @@ sub lilypond_element_target_name($$$)
   # TODO: Once texi2html correctly prints out the target and not the id for
   #       the sections, change this back to ($id, $target)
   $target = lc($target);
-  return ($target, $target);
+
+  # remove duplicate anchor generation
+  return ("", $target);
+  #return ($target, $target);
 }
 
 




reply via email to

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