public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Use pandoc to combine files and generate a liquid formula
@ 2019-05-13 20:17 Jp Valery
  0 siblings, 0 replies; only message in thread
From: Jp Valery @ 2019-05-13 20:17 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2297 bytes --]

Hi everyone,

Despite my best efforts, I couldn't find an answer to match my use case. 

We're using a liquid formula in our mailing tool to handle localization.
Concretely, it looks like this

> {% if {{Language}} contains 'en' %} //Content in English
> {% elsif {{Language}} contains 'fr' %} //Content in French
> {% elsif {{Language}} contains 'es' %} //Content in Spanish
> {% elsif {{Language}} contains 'pt' %} // Content in Portuguese
> {% elsif {{Language}} contains 'de' %} // Content in German
> {% elsif {{Language}} contains 'it' %} // Content in Italian
> {% elsif {{Language}} contains 'ja' %} // Content in Japanese
> {% else %} // Content in English as ultimate fallback if the user don't 
> match any of the above conditions
> {% endif %}
>

We're trying to automate our localization using .md files in a Github repo 
with Crowdin. 
The master file in english will be name.md 
Crowdin will generate localizations as name_XX.md where XX is the two 
letter language code. 

I had no issue combining multiple .md files with *pandoc*md > output.html*

What I'd like to achieve now is a way to generate an HTML file that would 
be 

> {% if {{Language}} contains 'en' %}
> [[name.md content]]
> {% elsif {{Language}} contains 'fr' %}
> [[name_fr.md content]]
> {% elsif {{Language}} contains 'es' %}
> [[name_es.md content]]
> {% elsif {{Language}} contains 'pt' %}
> [[name_pt.md content]]
> {% elsif {{Language}} contains 'de' %}
> [[name_de.md content]]
> {% elsif {{Language}} contains 'it' %}
> [[name_it.md content]]
> {% elsif {{Language}} contains 'ja' %}
> [[name_ja.md content]]
> {% else %}
> [[name.md content]]
> {% endif %}
>

What would be the best way to tackle this?

Thanks a lot for your help!

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2765baf6-c108-43e6-ad32-2ccd774e7989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3384 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-13 20:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 20:17 Use pandoc to combine files and generate a liquid formula Jp Valery

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).