Building Different Versions of a Title

Build tags provide a way to support different versions of a Viewer title without creating different source files for each version. You use build tags when you want to exclude certain topics from the finished title. If you don't use any build tags, then all topics get included in the title.

Each topic can have one or more build tags. Topics without build tags are always included in a build. For this reason, use build tags primarily to exclude specific topics from certain builds.

·To selectively include topics from a title :

1.In the topic files, assign build tags to selected topics.

2.Identify build tags in the project file [BUILDTAGS] section.

3.Specify which topics to build by using the BUILD option in the [OPTIONS] section of the project file.

The following sections describe each step of the process.

Note:

Using build tags slows down the compile process.

Assigning Build Tags

The first step in including topics is assigning build tags in the topic files for the title. Use an asterisk (*) footnote to code the build tag in the topic. This footnote must be the first character in the topic.

Valid build tags have an alphabetic character, optionally followed by one or more alphanumeric characters (you can also include quotation marks (“ ”)). Uppercase and lowercase letters are treated the same. Make sure not to include spaces within the tag itself.

·To assign a build tag:

1.Place the cursor before all other footnotes for that topic (the build-tag footnote character must be the first character in the topic).

2.Insert the asterisk (*) as the footnote reference mark.

A superscript asterisk ( * ) appears next to the heading.

3.Type the build tag name as the footnote; for example:

* DEMO

Make sure only a single space exists between the asterisk (*) and the build tag. Specify multiple build tags by separating them with a semicolon (;), as follows:

* DEMO; MASTER; TEST_BUILD

Identifying Build Tags

If you code build tags in your topic files, use the [BUILDTAGS] section of the project file to identify all the valid build tags for a particular Viewer project. You must list all build tags used in the topic files here. The following example shows the format of the [BUILDTAGS] section in a sample project file:

[BUILDTAGS]
DEMO                        ;topics to include in the demo build
MASTER                        ;topics to include in the master build
TEST_BUILD                ;topics to include in a mini-build for testing

The [BUILDTAGS] section can include up to 32 build tags. The Viewer compiler strips out any spaces it finds between the start of the build tag and the end of the tag.

Specifying Which Topics to Build

Enter a BUILD option in the [OPTIONS] section of the project file to tell the compiler which topics to include in the build. The BUILD option has the following syntax:

BUILD = expression

The expression is a logical expression that specifies which topics to include in the build. The logical symbols used inside an expression are evaluated in the following order:

Symbol Description

( ) Parentheses
~ NOT operator
& AND operator
| OR operator
tag Build tag

Evaluating Build Expressions

The Viewer compiler evaluates all build expressions from left to right in the following order:

1.Expressions within parentheses are evaluated first.

2.Expressions with a NOT (~) operator are evaluated next.

3.Expressions with an AND (&) operator are evaluated next.

4.Expressions with an OR (|) operator are evaluated next.

For example, if you coded MASTER, DEMO, and TEST_BUILD build tags in your topic files, you might include one of the following build expressions in the [OPTIONS] section:

Example Topics Built

BUILD = DEMO Only topics that have the DEMO tag and topics with no tags
BUILD = DEMO & MASTER Topics that have both the DEMO and the MASTER build tags and topics with no tags
BUILD = DEMO | MASTER Topics that have either the DEMO tag or the MASTER tag and topics with no tags
BUILD = (DEMO | MASTER) & TEST_BUILD Topics that have either the DEMO or the MASTER tag and that also have the TEST_BUILD tag
BUILD = ~ MASTER Topics that don't have a MASTER tag and topics with no tags