[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Identifying links to index nodes in HTML output
From: |
Gavin Smith |
Subject: |
Identifying links to index nodes in HTML output |
Date: |
Thu, 9 May 2019 19:13:05 +0100 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
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.
Does anybody have any ideas how to do this? I thought maybe the "rel"
attribute could be used on the <a> tag.
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.
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.
Another idea is to set a "class" attribute on the anchor tag.
- Identifying links to index nodes in HTML output,
Gavin Smith <=