asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.9k stars 299 forks source link

variable in include::[] path breaks include only in AsciidocFX #555

Closed alonbl closed 2 years ago

alonbl commented 2 years ago

Hello,

I found out that if I place a variable in the path of include::[] it fails to include the file. It works when running AsciidoctorJ. As far as I remember it used to work in AsciidocFX as I used this mechanism for a while in the past.

Reproduction

Files

attrs.adoci

:var1: value1

index.adoc

# Title
Alon Bar-Lev <alonbl@exodigo.ai>
:rootdir: .
include::{rootdir}/attrs.adoci[]

var1={var1}

Actual Result

var1={var1}

Expected Result

var1=value1

Hints

Replacing the {root} with its . value makes it work:

  1. The problem is not related to the include[] directive functionality.
  2. The problem is not related to the working directory.
 :rootdir: .
-include::{rootdir}/attrs.adoci[]
+include::./attrs.adoci[]
  1. AsciidoctorJ works fine, so I am lost.

Versions

Implications

In large tree of documents, it is important to sync settings between documents. Including a single attribute file enables this synchronization. This file is place in the root of the try and each nested directory needs to specify different location to reach the common resources. Having a variable that contains the root location that is shared among the directory files makes it easier to maintain the tree. It must be something trivial as it works with AsciidoctorJ.

Thanks,

rahmanusta commented 2 years ago

Hi,

There was a bug in new version. Could you please redownload and install the v1.7.5 from https://github.com/asciidocfx/AsciidocFX/releases/tag/v1.7.5 ?

alonbl commented 2 years ago

Thanks! Working.