[Top][All Lists]

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

Re: id attributes for header elements

From: Patrice Dumas
Subject: Re: id attributes for header elements
Date: Sun, 26 Dec 2021 21:04:44 +0100

On Sun, Dec 26, 2021 at 11:24:59AM -0800, Per Bothner wrote:
> On 12/26/21 10:29, Patrice Dumas wrote:
> > On Sun, Dec 26, 2021 at 10:08:50AM -0800, Per Bothner wrote:
> > > I don't remember, and I don't see how it could be better for navigation..
> > 
> > It was some time ago, at least some people expected the link to point to
> > the start of the header, and not to the heading command.
> I don't know of a browser which would show a user-visible difference
> between navigating to an element vs navigating to an empty element just
> before the element.  (And if there were a difference, perhaps some
> high-lighting the navigated-to element, I think navigating to a heading
> command would be better than nagivating to the empty element.)

I was not clear, the header is not the HTML element header, it is the
whole tree unit header, like

Next: Overview of Texinfo, Previous: Texinfo, Up: Texinfo   [Contents][Index]

> I believe putting the link on the sectioning command is slightly better (more
> semantically meaningful and easier to work with) than putting it before
> - and it is never worse.

I agree, and when there is no header in the sense of the header with
directions, I have made a change to have the id on the sectionning h*
element based on your report.

> > In my view, the @anchor{Electron} is not associated to the @subheading 
> > (except
> > for being before).  The @subheading has its own id as an heading not
> > associated to a Texinfo element.
> My point is that at least the id for the @subheading should be on the 
> generated heading.
> I.e.
> @subheading Element
> should generate:
> <h4 id="Electron">Electron</h4>

I agree, and the change I just commited does that, based on your

> > @node My node
> > @section Section
> > 
> > note that there is no id output especially for the sectionning command,
> > it is the id of the "element" (also called a tree unit) that encompasses
> > a unit of Texinfo.  In general it corresponds to a @node + sectioning
> > @-command + associated content.
> When there is a "tree unit" for a sectioning command, it makes sense
> to put the id on the corresponding <div>.  But when we just have a 
> @subheading,
> there is no <div>.  However, there is an <h4> element that corresponds 
> directly to
> the @subheading.  In that case it makes sense to put the id on the h4.

These cases are as you propose.  The <div> is before the header with

When there is no <div>, there is an empty <span> with the id, it is not
on the <h*>.  This happens only in some special cases, though, not in
the normal case.


reply via email to

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