Reuse topics and sections
Last modified: 16 September 2024You can add a topic into multiple instances. For example, if you have a topic about contacting your support team, you can publish it with every document in your documentation set.
Reuse single topics
In the Writerside tool window, select the instance to which you want to add an existing topic.
In the Table of Contents pane of the Writerside tool window, click and select Link Topic Files to TOC.
Find the topic that you want to use in the list and select it.
note
The list contains only topic files that are not yet in the current instance. You can start typing the name of the topic file to filter the list.
Alternatively, you can open the tree file in the editor and insert the <toc-element>
with the topic file manually.
<toc-element topic="contact_support.topic"/>
tip
If a topic not in the current instance is open in the editor, Writerside shows a notification in the top part of the editor. You can either switch to the instance with this topic or add it to the currently selected instance.
For more information, see Detect topic not in current instance.
Reuse sections with multiple topics
You can reuse any <toc-element>
or <snippet>
from a tree file in another tree file. It is recommended to keep all reusable TOC sections in a dedicated library instance.
Create a TOC library instance
Unlike regular instances, a library instance only defines reusable TOC sections and does not produce any output itself.
In the Writerside tool window, right-click the current instance name and select New Library.
Specify a library instance name and ID, and click OK.
Set an ID for every
<toc-element>
that you want to reuse, or wrap a group of TOC elements with<snippet>
.SnippetTOC element<snippet id="installation-guide"> <toc-element topic="Install.topic"/> <toc-element topic="Setup.topic"/> <toc-element topic="Update.topic"/> <toc-element topic="Uninstall.topic"/> </snippet>
<toc-element toc-title="Installation guide" id="installation-guide"> <toc-element topic="Install.topic"/> <toc-element topic="Setup.topic"/> <toc-element topic="Update.topic"/> <toc-element topic="Uninstall.topic"/> </toc-element>
To insert pieces of the library instance in other tree files, use the
<include>
element:<include from="lib.tree" element-id="installation-guide"/>
SnippetTOC element