Propagate roles and link attributes from xref in navigation to navigation entry
Currently, only the target and text of an xref in the navigation are propagated to the navigation entry. It can be very useful when building the navigation to be able to use additional information from from the xref. The most notable is the list of roles. With access to the roles, the logic that builds the navigation can allow behavior to be tuned (expand/collapse) or add special styling.
If specified, the roles should be stored as an array on the navigation entry in the navigation model. By making this change, it will expose the following two internal roles:
- xref - indicates the link is an xref
- (e.g., page) - the family of the target, if resolved; otherwise "unresolved"
In addition to the roles, the following information from the HTML anchor tag (which is generated from the xref macro) should be transferred.
- target as linkTarget
- rel as linkRel
- title as title (or linkTitle or advisoryInfo? or tooltip?)
The link prefix is used to disambiguate these properties from other uses in the future. If we decide it isn't warranted, we can drop it.
There may also be a need to capture the roles for a text-only navigation entry. We will address that need in a separate issue.