Solution 1 :

$icones$ is only referring to a single item in icones: inside the for loop, i.e. not inside the value of mais:. Likewise, the for loop iterates over $icones$, so $mais$ does not refer to a single value of the mais: sequence.

You could do something like this:

mais:
  - {url: {front: "filename.com/", back: "/logo=$gnome$"}}

And then:

$for(icones)$
  <img alt="$icones.nome$"   name="$icones.nome$"   src="https://$mais.first.url.front$$icones.nome$$mais.first.url.back$"/>
$endfor$

Problem :

Observe well the last variable mais, which will get the array from the variable icones:

  • YAML in a Markdown file:
---

gnome: 'gnome'

icones:
  - {nome: actions}
  - {nome: apps}
  - {nome: devices}
  - {nome: mimetypes}
  - {nome: places}
  - {nome: status}

mais:
  - {url: 'filename.com/$icones.nome$/logo=$gnome$'}

---
  • In another Markdown file:
$for(icones)$
  <img alt="$icones.nome$"   name="$icones.nome$"   src="https://$mais.url$"/>
$endfor$

The item will get successfully all the variables, but the variable $mais.url$ will not get the array variables.

Here is the result:

<img alt="actions"   name="actions"   src="https://"/>
<img alt="apps"   name="apps"   src="https://"/>
<img alt="devices"   name="devices"   src="https://"/>
<img alt="mimetypes"   name="mimetypes"   src="https://"/>
<img alt="places"   name="places"   src="https://"/>
<img alt="status"   name="status"   src="https://"/>

It should be like:

<img alt="actions"   name="actions"   src="https://filename.com/actions/logo=gnome"/>
<img alt="apps"      name="apps"      src="https://filename.com/apps/logo=gnome"/>
<img alt="devices"   name="devices"   src="https://filename.com/devices/logo=gnome"/>
<img alt="mimetypes" name="mimetypes" src="https://filename.com/mimetypes/logo=gnome"/>
<img alt="places"    name="places"    src="https://filename.com/places/logo=gnome"/>
<img alt="status"    name="status"    src="https://filename.com/status/logo=gnome"/>

Comments

Comment posted by mb21

I suppose those are pandoc template files, or..? how do you call pandoc? what version?

Comment posted by mb21

ah, shouldn’t it be

Comment posted by Oo’-

@mb21, yes, it is correct, my Pandoc version on Arch Linux is 2.8. I run the command

Comment posted by mb21

yes, like:

Comment posted by pandoc.org/MANUAL.html#templates

see

By