Provide invariant permalinks for subtopics
Posted: Wed May 31, 2023 6:28 pm
WebHelp provides handy "permalink" icons by section and subtopic titles that provide a link to that section or subtopic.
Given the following DITA source with three sections and three subtopics:
the permalink URLs are:
The section permalinks are derived from their ID values, but the subtopic permalinks are sequentially numbered "ariaid-title" values. As a result, if a new "Feature D2" subtopic is inserted, existing email/bookmark references to the subsequent subtopics E and F become incorrect.
It would be nice if subtopic permalinks could be invariant to structural changes in the same way that section permalinks are.
Testcase:
Given the following DITA source with three sections and three subtopics:
Code: Select all
<topic id="topic_id">
<title>My Topic</title>
<body>
<p>This is a topic.</p>
<section id="section_w3z_f5m_qxb">
<title>Feature A</title>
<p>This is about feature A.</p>
</section>
<section id="section_m3j_k5m_qxb">
<title>Feature B</title>
<p>This is about feature B.</p>
</section>
<section id="section_mnx_k5m_qxb">
<title>Feature C</title>
<p>This is about feature C.</p>
</section>
</body>
<topic id="topic_bqx_x5m_qxb">
<title>Feature D</title>
<body><p>This is about feature D.</p></body>
</topic>
<topic id="topic_tdh_y5m_qxb">
<title>Feature E</title>
<body><p>This is about feature E.</p></body>
</topic>
<topic id="topic_wcp_y5m_qxb">
<title>Feature F</title>
<body><p>This is about feature F.</p></body>
</topic>
</topic>
Code: Select all
Feature A section: file:/.../topic.html#topic_id__section_w3z_f5m_qxb
Feature B section: file:/.../topic.html#topic_id__section_m3j_k5m_qxb
Feature C section: file:/.../topic.html#topic_id__section_mnx_k5m_qxb
Feature D subtopic: file:/.../topic.html#ariaid-title2
Feature E subtopic: file:/.../topic.html#ariaid-title3
Feature F subtopic: file:/.../topic.html#ariaid-title4
It would be nice if subtopic permalinks could be invariant to structural changes in the same way that section permalinks are.
Testcase: