Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
I have a need for a document to somewhat dynamically produce content based on the type of output document desired. For example, we have a document that will be used internally by our team as well as externally outside our team and while there is a high percentile of overlapping of information, not everything made available in the internal version of the document should be included in the external version of the document.
I have used Tags to help address this by having child .adoc files for all of the main content with includes statements in a parent.adoc that will produce the output based on those tags. Right now I have everything working, but I have to maintain two "parent" files that incorporate the includes of the child.adoc files; one for 'internal' and one for 'external'. I'm wondering if there is a way to have an attribute defined in the parent document be used to specify the tag name in the include statement? Something like below so that I could update the output_type attribute and won't have to maintain two highly identical parent.adoc files. The only difference between the two parent.adoc files is which tag name is mentioned. :output_type: internal include::child.adoc[tags={output_type}] Thanks |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Thank you for your question. Attribute references are not currently resolved in the attribute list of an include directive. However, I think it's reasonable to expect that they would be. This is an enhancement. Can you file an issue? https://github.com/asciidoctor/asciidoctor/issues The issue should not about tags at all, since that is just one possible usage of this functionality. The issue is whether attribute references are resolved in the attrlist of an include directive (in the same way that they are for block macros) Cheers, -Dan On Sat, May 5, 2018 at 1:27 PM, zombi [via Asciidoctor :: Discussion] <[hidden email]> wrote: I have a need for a document to somewhat dynamically produce content based on the type of output document desired. For example, we have a document that will be used internally by our team as well as externally outside our team and while there is a high percentile of overlapping of information, not everything made available in the internal version of the document should be included in the external version of the document. ... [show rest of quote] Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Thank you for confirming. I have submitted the ticket as requested.
https://github.com/asciidoctor/asciidoctor/issues/2761 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
66 posts
|
In reply to this post by zombi
Zombi,
A workaround you could use in order to have just a single parent document would be to use the following in the parent file: //Set :output_type: to "internal" or "external" :output_type: internal ifeval::["{output_type}" == "internal"] include::child.adoc[tags=internal] endif::[] ifeval::["{output_type}" == "external"] include::child.adoc[tags=external] endif::[] Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In reply to this post by zombi
Thanks @zombi. -Dan On Sun, May 6, 2018 at 8:00 AM, zombi [via Asciidoctor :: Discussion] <[hidden email]> wrote: Thank you for confirming. I have submitted the ticket as requested. Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |