Update map to reflect nested subtopic structure
Posted: Tue Aug 03, 2021 9:27 pm
In DITA, a topic file can contain nested subtopic structure in that same file:
These nested subtopics require corresponding nested topicrefs in the map:
A similar requirement exists for glossary term definitions nested in a glossary file:
Without these nested-topic topicrefs,
Some challenges exist:
A testcase is attached. To run,
Code: Select all
<topic id="my_topic_id">
<title>My Topic</title>
<body>...</body>
<topic id="my_subtopic1_id"> <!-- nested subtopic -->
<title>My Subtopic #1</title>
<body>...</body>
</topic>
<topic id="my_subtopic2_id"> <!-- nested subtopic -->
<title>My Subtopic #2</title>
<body>...</body>
</topic>
</topic>
Code: Select all
<topicref href="my_topic.dita" keys="my_topic">
<topicref href="my_topic.dita#my_subtopic1_id" keys="my_subtopic1"/> <!-- nested topicref -->
<topicref href="my_topic.dita#my_subtopic2_id" keys="my_subtopic2"/> <!-- nested topicref -->
</topicref>
Code: Select all
<topicref href="glossary.dita">
<topicref href="glossary.dita#oxygen_xml_author_id" keys="oxygen_xml_author"/> <!-- nested topicref -->
<topicref href="glossary.dita#oxygen_xml_developer_id" keys="oxygen_xml_editor"/> <!-- nested topicref -->
<topicref href="glossary.dita#oxygen_xml_editor_id" keys="oxygen_xml_editor"/> <!-- nested topicref -->
</topicref>
- Keyrefs to the subtopics or any content within the subtopics cannot be constructed.
- Navigation links to subtopics are missing in in HTML/WebHelp outputs.
Some challenges exist:
- What if a topic is edited, but one or more map files referencing that topic are not also open for editing? This might require some sort of update operation that is run on a map. Or perhaps the "Main Files" infrastructure could detect when there are map references to a topic being edited, and update them as needed.
- Profiling conditions must be synchronized between subtopic elements and their topicrefs. Otherwise, subtopic links can appear in HTML/WebHelp navigation despite the topic itself not being present, or vice versa.
A testcase is attached. To run,
- Open the project file.
- Open the "without" map.
- Publish WebHelp, and note that the subtopics are missing from navigation.
- Attempt to "Paste as link (keyref)" for a subtopic and note that Oxygen gives an error that the item cannot be referenced.
- Open the "with" map and note that both these operations are successful