Login  Register

multiple output versions of one document?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

multiple output versions of one document?

ascju
8 posts
hey,

maybe i need to find another (non asciidoctor releated) solution for this, but i thought i'll give it a try:

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.

is there a way to mark/tag areas and have control over what to print as PDF / render as HTML?

i hope that was clear... :)

thanks in advance!

cheers,
chris
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: multiple output versions of one document?

kibukj
8 posts
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.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: multiple output versions of one document?

mojavelinux
Administrator
2681 posts
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
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: multiple output versions of one document?

ascju
8 posts
In reply to this post by ascju
awesome! that is exactly what i need!
thanks, kibukj!