[Top][All Lists]

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

Re: two small [Contents] button blemishes

From: Patrice Dumas
Subject: Re: two small [Contents] button blemishes
Date: Sun, 14 Feb 2021 13:03:58 +0100

On Sat, Feb 13, 2021 at 10:08:28PM -0800, Per Bothner wrote:
> On 2/12/21 6:24 PM, Per Bothner wrote:
> > (2) If js-info is enabled then the [Contents] button seems to do nothing, 
> > since we
> > aleady have the navigation bar.  Hiding it using CSS isn't possible, 
> > because it is
> > surrounded by "[" and "]" (which are not in their own element).  Eleminating
> > it using JavaScript is possible but a bit fragile/ugly.
> Attached is a preliminary patch for fixing the [Contents] links in the 
> js-info reader.
> It creates a new page-node with a copy of the table of contents.
> (We need a copy distinct from the one in the side-bar.)
> It mostly works, but needs some polishing.
> It would be easier and cleaner if we could improve the generated HTML.
> Instead of:
>     <span id="SEC_Contents"></span>
>     <h2 class="contents-heading">Table of Contents</h2>
>     <div class="contents">
>       <ul>
>         <li><a id="toc-Features-and-screenshots" 
> href="Features.html">Features and screenshots</a></li>
>       ...
> I think this would be cleaner and easier to work with:
>     <div id="SEC_Contents" class="contents">
>       <h2 class="contents-heading">Table of Contents</h2>
>       <ul>
>         <li><a id="toc-Features-and-screenshots" 
> href="Features.html">Features and screenshots</a></li>
>       ...
> I figured out that the <div class="contents"> is generated in 
> _default_contents,

You propose to remove the <div class="contents">, but I guess that it
could be useful, as it should mark the table of contents itself, not the
table of contents plus its title and headers.

Beware that there are different cases/locations for contents or shortcontents
formatting, as a separate element, inline, or after the title.  And
shortcontents can also be in a frame.  Unless I missed a possibility,
however, in every case the table of contents element class should always
be Contents_element, and the shortcontents table should always be 

> but I don't know where the <span id="SEC_Contents"></span> and <h2 ...> are
> generated.  

It is in _contents_inline_element.  I will change it to be in a <div>, the
class will be Contents_element.

> Searching for 'contents' doesn't help as the word used for multiple things!

Indeed, 'contents', 'args' and 'extra' are the main keys of the tree, so
searching for those will not be very helpful...


reply via email to

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