bug-texinfo
[Top][All Lists]
Advanced

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

Re: Identifying links to index nodes in HTML output


From: Patrice Dumas
Subject: Re: Identifying links to index nodes in HTML output
Date: Fri, 10 May 2019 10:49:09 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, May 09, 2019 at 07:13:05PM +0100, Gavin Smith wrote:
> I think there should be a more reliable way to identify links to
> index nodes from the table of contents in index.html in HTML output.
> Currently the only way is to check if "Index" appears in the name of
> the page.  This would be used in an "HTML-Info" system, providing the 
> functionality of Info using HTML.

I may be missing something, but it seems to me that the first node with
printindex is used, see _prepare_global_targets() in Texinfo/Convert/HTML.pm.

But maybe you are referring to something else?

> Does anybody have any ideas how to do this?  I thought maybe the "rel" 
> attribute could be used on the <a> tag.

It seems to be to be consistent with the intended use of rel.

As a side note, there could even be empty <a> with the rel index for
each index entry.  Not sure that it would be very useful, though.  For
example

<span id="index-verbatim"><a href="Command-and-Variable-Index.html"
rel="index></a></span>

> According to https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types,
> the "index" value for the attribute is obsolete since HTML 5, and it 
> doesn't mean exactly the right thing:
> 
> >Indicates that the page is part of a hierarchical structure and that 
> >the hyperlink leads to the top level resource of that structure.
> >
> >If one or several up link types are also present, the number of these up 
> >indicates the depth of the current page in the hierarchy.
> 
> This appears to suit the index.html page (i.e. the Top node) better than 
> the actual document indices.
> 
> But the standard for HTML 4.01 at 
> https://www.w3.org/TR/html401/types.html#type-links has a more promising 
> description:
> 
> > Refers to a document providing an index for the current document.

Currently it is this interpretation that it used, as the rel link points
to the Index global target, as seen in %BUTTONS_REL.  But it is only
present in the header.

> Maybe it doesn't matter if "index" is used.  I'm not sure if you are 
> allowed to use your own values for the "rel" attribute. 
> https://www.w3.org/TR/html401/types.html#type-links says you can define 
> your own link types and should declare a "meta data profile" if you do 
> so, but that standard is out-of-date.
> 
> https://www.w3.org/TR/html50/links.html#linkTypes says that you should 
> register extensions officially, and conformance checkers would check 
> whether the values were registered.  "index" is registered at 
> http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions
> so it should be OK to use.  The description there is appropriate:
> 
> >Refers to a document providing a list of topics with pointers that 
> >pertain to the current document.

I think we can use it then.

> Another idea is to set a "class" attribute on the anchor tag.

-- 
Pat



reply via email to

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