CDSoft / panda

Panda is a Pandoc Lua filter that works on internal Pandoc's AST. Panda is heavily inspired by [abp](http:/cdelord.fr/abp) reimplemented as a Pandoc Lua filter.
https://cdelord.fr/panda
GNU General Public License v3.0
44 stars 5 forks source link

Variable expansion doesn't work on `include` #10

Closed lontivero closed 2 years ago

lontivero commented 2 years ago

I'm using panda as part of my wiki site generator and i need the paths to be relative to the wiki root directory. I wanted to solve it by doing:

```meta
wroot = "/home/user/Documents/Wiki/src/wasabi"
```

:::{include={{wroot}}/radical_ideas.md}}
whatever
:::

But it doesn't include the file. Instead it results in:

image

However, if I hardcode the file path it works like charm.

lontivero commented 2 years ago

Sorry for the spam. It works, i just needed to escape the variable pattern as follow:

:::{include=\{\{wroot\}\}/radical_ideas.md}
whatever
:::
CDSoft commented 2 years ago

Hello, You can make it easier to read with quotes:

::: { include="{{wroot}}/radical_ideas.md" }
whatever
:::

BTW your first example also had two brackets at the end of the line.