In pandoc, you can see if you have a variable or not ($if(something)$ put $something$ $endif$
), but I want to act depending on its value. Something like:
$if(lang)=='en'$ Hello $else$ Aloha $endif$
Is it possible? In Pandoc Manual I don't see nothing
That would have been inside Pandoc Manual if there was such a feature and according to this pandoc-discuss it is not possible with pandoc.
What it is possible, is to define some more general variables that will contain things you want to change.
For example if you want to use the English language, set a variable lang.en
and check it with $if(lang.en)$
. If you want another language then unset lang.en
and set lang.fr
and use it like this:
$if(lang.en)$
Hello
$else$
Aloha
$endif$
$if(lang.fr)$
Bonjour
$else$
Aloha
$endif$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With