Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
We have a document structure somewhat like this:
./MainDocument.adoc (contains include-statements) ./images/lots-of-images.png ./includes/document-sections.adoc When processing the MainDocument, images must be referenced as "./images/image.png", both from inside MainDocument.adoc and includes/some-section.adoc. However, when using an editor (Intellij, AsciidocFx) to edit includes/document-sections.adoc, "./images/image.png" is not visible. Is it possible to have a "conditional" attribute statement, so that MainDocument.adoc sets ":imagedir: ./images" and includes/some-section.adoc sets ":imagedir:../images" -- but where only the first declaration is used? In other word: Is is possible to avoid processing attribute Eirik |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
You'll be happy to know, it is supported very easily :)
For those scenarios you can use the conditional statements. They work with predefined attributes and custom ones as well: http://asciidoctor.org/docs/user-manual/#ifdef-directive. For example, see how icons get a special treatment when an attribute set by GitHub is defined (env-github) here https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/README.adoc If you use IntelliJ, it defines the attribute `env-idea` to customize the images path for a specific document. Also, you may be interested in checking how to unset attributes with the `!` symbol: http://asciidoctor.org/docs/user-manual/#using-attributes-set-assign-and-reference. |
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 elygre
> Is it possible to have a "conditional" attribute statement, so that MainDocument.adoc sets ":imagedir: ./images" and includes/some-section.adoc sets ":imagedir:../images" -- but where only the first declaration is used? ifndef::imagesdir[:imagesdir: fallback/if/not/already/set] As Abel suggested, you can check for other attributes instead. -Dan On Wed, Oct 4, 2017 at 4:31 AM, elygre [via Asciidoctor :: Discussion] <[hidden email]> wrote: We have a document structure somewhat like this: ... [show rest of quote] Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |