Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
This post was updated on Nov 14, 2019; 10:14am.
So i have separate file with content like this:
Some text (<<id1>>) + [[id1]] .Image title image::image1.png[] In my main document i have to include those snippet few times like this: include::snippet.adoc[] The problem is that when i try to build PDF, i get errors asciidoctor: WARNING: main.adoc: line 24: id assigned to block already in use: id1 What can i do in this situation? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I tried to solve this by using variables in image ID and changing its value each time before include:
in snippet.adoc: Some text (<<{id_variable}>>) + [[{id_variable}]] .Image title image::image1.png[] in main.adoc: Some text some text some text :id_variable: _first-include include::snippet.adoc[] Another text another text another text :id_variable: _second-include include::snippet.adoc[] BUT it does not work. Probably, asciidoctor doesn't allow using of variables in id's... Any help? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
There is an alternative syntax for IDs that works for me on Asciidoctor 2.0.10. Instead of double-braces I used single braces and a hash:
[#{id_variable}] .Image title image::image1.png[] After that change the examples seemed to work for me.
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Wow, now it works, thanks!
Ah, by the way, maybe you know: is it possible to do simple calculations with variables values? Like, for example: :variable1: 21 :variable2: {variable1} - 1 This should say "20": {variable2} |
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
|
In reply to this post by Alexander Schwartz
>
There is an alternative syntax for IDs that works for me on Asciidoctor
2.0.10. Instead of double-braces I used single braces and a hash: Exactly correct! The legacy double bracket syntax for IDs doesn't support attribute references for compatibility reasons. (See https://github.com/asciidoctor/asciidoctor/issues/1381). Best, -Dan On Wed, Nov 13, 2019 at 6:35 AM Alexander Schwartz [via Asciidoctor :: Discussion] <[hidden email]> wrote: There is an alternative syntax for IDs that works for me on Asciidoctor 2.0.10. Instead of double-braces I used single braces and a hash: ... [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
|
In reply to this post by Hoplop
> is it possible to do simple calculations with variables values? No, that is not possible. Best, -Dan On Thu, Nov 14, 2019 at 1:38 AM Hoplop [via Asciidoctor :: Discussion] <[hidden email]> wrote: Wow, now it works, thanks! -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |