dalibo / pandocker

🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
https://hub.docker.com/r/dalibo/pandocker/
BSD 3-Clause "New" or "Revised" License
145 stars 23 forks source link

pandoc-mustache inline arguments #144

Closed daamien closed 4 years ago

daamien commented 4 years ago

Question from @DigitalTravelDuck posted at https://github.com/dalibo/pandocker/issues/141#issuecomment-577839253

Hello Damien,

Do you know if it is possible to give the vars.yaml file as an argument
with - - filter pandoc-mustache?
or any other way to use one markdown file and 2 different vars file to
generate 2 different pdf's out of 1 markdown ?

would be great.

Thanks,
Arnold.
daamien commented 4 years ago

@DigitalTravelDuck:

Yes can use the --metadata (or -M) option to modify the mustache parameter directly from the command line:

Here's a basic exemple:

$ alias pandocker='docker run --rm -v `pwd`:/pandoc dalibo/pandocker'
$ echo "Hello, {{x}} !" > hello.md
$ echo "x: World" > world.yml
$ pandocker -i hello.md --filter pandoc-mustache -M mustache=world.yml
<p>Hello, World !</p>

And just change the mustache variable to point to another YAML file

$ echo "x: Arnold" > arnold.yml
$ pandocker -i hello.md --filter pandoc-mustache -M mustache=arnold.yml
<p>Hello, Arnold !</p>
DigitalTravelDuck commented 4 years ago

Thanks, works great. Greetings, Arnold.

On Thu, 23 Jan 2020, 22:50 damien clochard, notifications@github.com wrote:

@DigitalTravelDuck https://github.com/DigitalTravelDuck:

Yes can use the --metadata (or -M) option to modify the mustache parameter directly from the command line:

Here's a basic exemple:

$ alias pandocker='docker run --rm -v pwd:/pandoc dalibo/pandocker' $ echo "Hello, {{x}} !" > hello.md $ echo "x: World" > world.yml $ pandocker -i hello.md --filter pandoc-mustache -M mustache=world.yml

Hello, World !

And just change the mustache variable to point to another YAML file

$ echo "x: Arnold" > arnold.yml $ pandocker -i hello.md --filter pandoc-mustache -M mustache=arnold.yml

Hello, Arnold !

options direct

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dalibo/pandocker/issues/144?email_source=notifications&email_token=ANK6JHHVX3BDPIUJWDT3XOLQ7IGKFA5CNFSM4KK5IBQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJY7J2Y#issuecomment-577893611, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANK6JHGWQO36NQA5KRE5UGDQ7IGKFANCNFSM4KK5IBQQ .