Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Team,
Here is a question about the usage of variables inside the theme file. I would like to accomplish the following: depending on a variable defined inside a document, chose a specific background image for my title page. For example, my .adoc file contains ":location: Sydney" And my Theme file contains: title_page_background_image: image:/data/front_page_{location}.png[] I was expecting that "front_page_{location}.png" would get substituted to "front_page_Sydney.png". However, in practice this does not happen. NOTE: this does work for the "include::" directive inside an .adoc file. I also had a look at using a custom variable inside the theme file. Along the lines of: setlocation: {location} title_page_background_image: image:/data/front_page_$setlocation.png[] Unfortunately, this doesn't work either. It does work if I do "setlocation: Sydney"; but that defeats the purpose. Is this a current limitation of the software? Any ideas and suggestions are welcome. 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
|
I'm assuming you're talking about the theme file for Asciidoctor PDF. While Asciidoctor PDF does have support for variables, those variables must be defined in the theme file itself. The theme file cannot currently reference AsciiDoc document attributes (such as those defined in the document or via the API or CLI). Here's information about the variables currently work. Cheers, -Dan On Mon, Apr 23, 2018 at 2:51 PM, 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi Team, ... [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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Dan,
Thanks for your quick reply. I am indeed talking about the theme file used by asciidoctor-pdf. The theme file does seem to be able to reference AsciiDoc document attributes defined in the document. For example, I am currently successfully using: page_recto_left_content: '{project_name}' page_verso_right_content: '{project_name}' ...whereby :project_name: is defined inside the document itself. 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
|
That's the one exception. The reason is, we actually treat the content fields as part of the AsciiDoc document. That integration is explained here: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#attribute-references -Dan On Mon, Apr 23, 2018 at 5:28 PM, 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Dan, ... [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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Dan,
That makes sense. Thank you for explaining. 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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by mojavelinux
Anyone know if support for variable references for asciidoctor pdf is planned?
Dynamically creating my documentations header/footer information with version and revision number, release date etc. would make my life so much easier... |
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
|
You can use AsciiDoc attribute references in the header and footer content (for example, {revnumber}). This content is subject to normal substitutions, just like in the AsciiDoc document itself. On Tue, May 15, 2018 at 2:29 PM, ascju [via Asciidoctor :: Discussion] <[hidden email]> wrote: Anyone know if support for variable references for asciidoctor pdf is planned? 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 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Wow ... thanks for the super-fast reply.
I did miss this part of the pdf documentation (which by the way is really great!). Works like a charm. I'm happy! 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
|
I'm glad to hear that! Good luck! -Dan On Tue, May 15, 2018 at 3:42 PM, ascju [via Asciidoctor :: Discussion] <[hidden email]> wrote: Wow ... thanks for the super-fast reply. Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |