Writerside Help

Make titles differ

If you use a topic in several help instances, you can change topic, chapter, and procedures titles depending on the output.

Use variables to change the topic title

  1. Add a variable in v.list file and specify different values for each instance.

    <var name="settings_page_name" instance="web" value="Setting up on the web"/> <var name="settings_page_name" instance="mob" value="Setting up on mobile"/>
  2. Use it in the title attribute of the topic element.

    <topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd" id="Setting_up_web" title="%settings_page_name%">

Use filters or variables to change the chapter title

If you reuse a chapter or a procedure, you can adjust its title using filters or variables.

  • Use the instance variable in the title.

    <snippet id="some-id"> <chapter title="The base title"> <title instance="ab">The custom title</title> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p> </chapter> </snippet>

    In this case for all instances the title will be The base title, while for the ab instance — The custom title.

  • Use a custom title variable inside a snippet and redefine it in the include block.

    <snippet id="id"> <var name="title" value="An initial title"/> <chapter title="%title%"> <p>This is a chapter.</p> </chapter> </snippet> <include from="topic-a.topic" element-id="id"> <var name="title" value="A custom title"/> </include>
  • Use the filter attribute in the title.

    <snippet id="connections_to_dbs"> <procedure> <title filter="mysql"> Connection to MySQL </title> <title filter="postgres"> Connection to PostgreSQL </title> </procedure> </snippet>
Last modified: 23 May 2024