Login  Register

Re: multiple output versions of one document?

Posted by mojavelinux on Mar 12, 2019; 5:47am
URL: https://discuss.asciidoctor.org/multiple-output-versions-of-one-document-tp6795p6797.html

Well said, @kibukj!

Cheers,

-Dan


On Mon, Mar 11, 2019 at 5:42 PM kibukj [via Asciidoctor :: Discussion] <[hidden email]> wrote:
ascju wrote
I have a user documentation written in asciidoc and now plan on having multiple versions of this product.
These products mainly differ in functionality which is not included in all versions, so basically all documentation is identical except there are parts which do not apply to one product and are only available in the other one.
This sounds like a job for conditional processing:
https://asciidoctor.org/docs/user-manual/#conditional-preprocessor-directives

Here's an example:
= General

This text applies to all versions of the product.

ifdef::variant-a[]
This text only applies to variant A of the product.
endif::[]

ifdef::variant-b[]
This text only applies to variant B of the product.
endif::[]

You can then control which information is presented with the -a (or --attribute) flag to asciidoctor:
$ asciidoctor -a variant-a general.adoc
will only include text that applies to variant A, and
$ asciidoctor -a variant-b general.adoc
will only include text that applies to variant B.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/multiple-output-versions-of-one-document-tp6795p6796.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux