[Top][All Lists]

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

Re: id attributes for header elements

From: Per Bothner
Subject: Re: id attributes for header elements
Date: Sun, 26 Dec 2021 11:24:59 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

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 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.

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 


@subheading Element

should generate:

<h4 id="Electron">Electron</h4>

It feel wrong to generate a separate empty <span> in this case.
It may be reasonable to do so for @anchor - but not for a @subheading.

In a case like

@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 
the @subheading.  In that case it makes sense to put the id on the h4.
        --Per Bothner
per@bothner.com   http://per.bothner.com/

reply via email to

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