Conditional content generation
By default, all topics and content created in an HelpNDoc project will be generated in every builds and documentation formats. It is possible to conditionally generate topics and content using build tags and conditions:
- Build tags represent unique identifiers which can be associated with a topic or a part of a topic
- Conditions are instructions indicating whether a section is included or not based on specific tags
Conditional topic generation
A topic can be included or not in specific builds based on build kind and build tags. By default a topic is included in all builds. To choose which build will include a topic, select the topic in the table of contents then:
- From the "Home" ribbon tab, click "Topic properties", then "Include in builds" and select each build kind and custom tag that applies
- Or right click on the topic and choose options in the "Include in builds" popup menu
See the How to setup conditional topic generation step-by-step guide.
Conditional content generation
HelpNDoc provides an easy way to define sections (parts of topics) which will only be included in specific builds using conditional sections. Those logical statements (If, Else, End) can be inserted within a topic using the "Insert" ribbon tab.
Using the "Insert conditional operation" dialog box, choose between one of the operations:
- IF: Start of a conditional section. The content written after this operation will be included only if the tags are included (IF) or not included (IF NOT) in the current build;
- ELSE: Will negate any previous IF operation. As an example, if the previous IF operation included "CHM and HTML", the ELSE operation will included everything but those;
- END: Will close the open conditional sections. Any content written after an END statement will be included in every builds without any condition.
Note: Conditional tags can't be nested.
See the How to setup conditional content generation step-by-step guide.
Define custom tags
To define custom tags, you can either:
- Right click on a topic, hover "Included in builds" then click "Manage build tags"
- From the "Generate help" window, select a build and click "customize" if the "Included tags" is not visible" then click "Manage tags"
See the How to manage build tags step-by-step guide.
Associate tags with builds
Each build can include one or more custom tag. To add custom tags to a specific build:
- Click the top part of the "Generate help" button in the "Home" ribbon tab
- Select a build
- Click "Customize" if the "Included tags" tab is not already visible
- Select the "Included tags" tab
- Check any custom tag that will be included in that build
See the How to maintain tags associated with output builds step-by-step guide.