Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
Hi,
I have a document composed of multiple hirarchical sub-documents. Is there any way to pass the attributes (especially the tags attribute) from an included file to its include statement? Example: main.adoc: include::sub.adoc[tags=topic] sub.adoc: include::sub2.adoc[] //<- this is where I need tags to be the same as in main.adoc sub2.adoc: //tag::topic[] some text //end::topic[] some other text desired output: some text Thanks, Sebastian |
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
|
Sebastian, I would recommend using document attributes for this: main.adoc :tags: topic include::sub.adoc[tags={tags}] sub.adoc include::sub2.adoc[tags={tags}] A document attribute is available for as long as it remains set or you change the value. See https://asciidoctor.org/docs/user-manual/#setting-attributes-on-a-document for more details. Cheers, -Dan On Thu, Aug 30, 2018 at 6:21 AM, tes_staiger [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi, ... [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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
Hi,
thanks for your quick answer. Unfortunately this does not seem to work. I am getting the following message: asciidoctor: WARNING: main.adoc: line 3: tag '{tags}' not found in include file: sub.adocIt seems the attribute is not resolved for the include statement. |
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
|
That should work. What version of Asciidoctor are you using? You can find out using {asciidoctor-version} -Dan On Fri, Aug 31, 2018 at 2:00 AM, tes_staiger [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi, ... [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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
In fact, there is a test for this feature. -Dan On Fri, Aug 31, 2018 at 2:42 AM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
3 posts
|
In reply to this post by mojavelinux
I am using Version 1.5.7.1
just installed with "gem install asciidoctor" Using the attreibute {tags} somewhere int the text is working. I just saw that you added that feature to milestone 1.5.8 What is the best/simplest way to install that version? |
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
|
Oh, you're right! My mistake. It was added only days after the release, which is why I was confused. Here's how to run and/or install the gem locally. In the project, you can run: rake then gem install pkg/*.gem -Dan On Fri, Aug 31, 2018 at 2:55 AM, tes_staiger [via Asciidoctor :: Discussion] <[hidden email]> wrote: I am using Version 1.5.7.1 Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |