Page 1 of 1

Provide invariant permalinks for subtopics

Posted: Wed May 31, 2023 6:28 pm
by chrispitude
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:

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>
the permalink URLs are:

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
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:
webhelp_invariant_subtopic_links.zip

Re: Provide invariant permalinks for subtopics

Posted: Tue Jun 13, 2023 11:06 am
by cosmin_andrei
Hi Chris,
Thank you for your feedback!
I have added an issue in our internal issues tracker (WH-3173) in order to be further analyzed by our development team.

Re: Provide invariant permalinks for subtopics

Posted: Thu Jun 22, 2023 1:00 am
by chrispitude
I noticed that the links in the left-side navigation TOC and right-side "On this page" TOC show the desired ID-based links:

Code: Select all

Feature D subtopic: file:/.../topic.html#topic_bqx_x5m_qxb
Feature E subtopic: file:/.../topic.html#topic_tdh_y5m_qxb
Feature F subtopic: file:/.../topic.html#topic_wcp_y5m_qxb
This makes sense because these links are derived from the DITA-OT-computed navigation link hierarchy. So I guess the enhancement would be for WebHelp publishing to somehow use that same DITA-OT-computed navigation data.

Re: Provide invariant permalinks for subtopics

Posted: Fri Jun 23, 2023 11:59 am
by radu_pisoi
Indeed, the links value should be consistent for permalinks and On this page component. I have updated out internal issue with these details.