From: "'juh' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: nested iteration over variables
Date: Mon, 11 Oct 2021 14:54:19 +0200 [thread overview]
Message-ID: <YWQz+zPweCOgd31D@sokrates> (raw)
In-Reply-To: <m2o880hkyu.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 669 bytes --]
Dear John,
thanks a lot.
Am Thu, Oct 07, 2021 at 09:13:13AM -0700 schrieb John MacFarlane:
>
> Set up the metadata like this:
>
> ```
> ---
> positions:
> foo:
> - name: Foo
> feature: 2
> - name: Bar
> feature: 3
> bar:
> - name: Bar
> feature: 55
> ...
> ```
>
> You can use the anaphoric variable name "it".
>
> ```
> $for(positions)$
> Foos:
> $for(it.foo)$
> $it.name$, $it.feature$
> $endfor$
> Bars:
> $for(it.bar)$
> $it.name$, $it.feature$
> $endfor$
> $endfor$
> ```
Additional question. Is it possible to use some logic in if-statements?
$if(foo=2)$
Foo is Two.
$elseif(foo=1)$
Foo is One.
$else$
No Foo left.
$endif$
TIA
juh
next prev parent reply other threads:[~2021-10-11 12:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 15:20 'Jan Ulrich Hasecke' via pandoc-discuss
[not found] ` <8fa0e255-4ed7-4db7-eb28-a9aaa8b55613-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2021-10-07 16:13 ` John MacFarlane
[not found] ` <m2o880hkyu.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-10-11 12:54 ` 'juh' via pandoc-discuss [this message]
2021-10-11 15:39 ` John MacFarlane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YWQz+zPweCOgd31D@sokrates \
--to=pandoc-discuss-/jypxa39uh5tlh3mbocffw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).