Automation & Single-Source Publishing

In addition to quick export, you can also save issues as a product. This means that your settings for format, style, attributes and more are retained. You can therefore re-export the product at any time.

Inserting Attributes & Conditions

Earlier in the learning path, we described how we created the manual for adoc Studio so that the corresponding images are included on each platform. To make this work, we created products for each platform and populated them with attributes.

Let's take the iPad version of our manual as an example. The following syntax is used here in many places:

image::{platform}/image.jpg[]

The logic is quickly explained: adoc Studio now searches for the image “image.jpg” in a specific path. The :platform: attribute was defined in the product: In the case of the iPad version, this is not {platform}, but “iPad”. As a result, the path “iPad/image.jpg” is now selected for the iPad product, while the Mac version leads to the path “Mac/image.jpg”, for example.

Another advantage for products can be seen in the conditions. They can be used to show or hide texts in the preview and output. This allows you to tailor your texts to specific target groups, for example. There are 3 conditions:

  • ifdef:: Condition is active if the attribute is defined

  • ifndef:: Condition is active if the attribute is not defined

  • ifeval:: Condition is active if the attribute is evaluated as true

Once again, our adoc Coach will help you to select the right condition.

Let's stay with the platform example. For example, we want to display a text only for the iPad version. Then we can check here whether the :ipad: attribute has been defined in the document and only then output the text.

ifdef::ipad[]
(Here is the text for the iPad version)
endif::[]