public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Combine multiple files with multiple template variables
@ 2015-03-04  4:02 Ranjit Jhala
       [not found] ` <07167e40-a024-4bf2-b874-4f4e790920f1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ranjit Jhala @ 2015-03-04  4:02 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Dear Pandoc users,

Is there a way I can write a, say, HTML template file that looks like:

    ... $body1$ ... $body2$ ...

and then have the contents of the two template variables be filled in
by converting the contents of two markdown files

  file1.md 

  file2.md

?

(I can think of hacks to do this such as have the first template "generate" 
the second template, i.e. have a template T1

    ...$body$... $$body$$...

run pandoc once with  T1 and file1.md, then run pandoc a second time with
the output file and file2.md, but was wondering if there was a direct way 
to 
achieve this?)

Thanks in advance!

- Ranjit.

-- 
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/07167e40-a024-4bf2-b874-4f4e790920f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine multiple files with multiple template variables
       [not found] ` <07167e40-a024-4bf2-b874-4f4e790920f1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-03-04  5:46   ` John MacFarlane
       [not found]     ` <20150304054622.GA64297-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2015-03-04  5:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You could always do something like this:

    echo "" | pandoc -V body1="$(pandoc file1.md)" -V body2="($pandoc file2.md) \
      --template=mytemplate.html -s

+++ Ranjit Jhala [Mar 03 15 20:02 ]:
>Dear Pandoc users,
>
>Is there a way I can write a, say, HTML template file that looks like:
>
>    ... $body1$ ... $body2$ ...
>
>and then have the contents of the two template variables be filled in
>by converting the contents of two markdown files
>
>  file1.md
>
>  file2.md
>
>?
>
>(I can think of hacks to do this such as have the first template "generate"
>the second template, i.e. have a template T1
>
>    ...$body$... $$body$$...
>
>run pandoc once with  T1 and file1.md, then run pandoc a second time with
>the output file and file2.md, but was wondering if there was a direct way
>to
>achieve this?)
>
>Thanks in advance!
>
>- Ranjit.
>
>-- 
>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/07167e40-a024-4bf2-b874-4f4e790920f1%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine multiple files with multiple template variables
       [not found]     ` <20150304054622.GA64297-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2015-03-04 13:08       ` Ranjit Jhala
       [not found]         ` <aa5ef3ac-e5f7-4840-985a-68664a847ab1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ranjit Jhala @ 2015-03-04 13:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Ah, very nice! Thanks!

On Tuesday, March 3, 2015 at 9:46:39 PM UTC-8, John MacFarlane wrote:
>
> You could always do something like this: 
>
>     echo "" | pandoc -V body1="$(pandoc file1.md)" -V body2="($pandoc 
> file2.md) \ 
>       --template=mytemplate.html -s 
>
> +++ Ranjit Jhala [Mar 03 15 20:02 ]: 
> >Dear Pandoc users, 
> > 
> >Is there a way I can write a, say, HTML template file that looks like: 
> > 
> >    ... $body1$ ... $body2$ ... 
> > 
> >and then have the contents of the two template variables be filled in 
> >by converting the contents of two markdown files 
> > 
> >  file1.md 
> > 
> >  file2.md 
> > 
> >? 
> > 
> >(I can think of hacks to do this such as have the first template 
> "generate" 
> >the second template, i.e. have a template T1 
> > 
> >    ...$body$... $$body$$... 
> > 
> >run pandoc once with  T1 and file1.md, then run pandoc a second time 
> with 
> >the output file and file2.md, but was wondering if there was a direct 
> way 
> >to 
> >achieve this?) 
> > 
> >Thanks in advance! 
> > 
> >- Ranjit. 
> > 
> >-- 
> >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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/07167e40-a024-4bf2-b874-4f4e790920f1%40googlegroups.com. 
>
> >For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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/aa5ef3ac-e5f7-4840-985a-68664a847ab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combine multiple files with multiple template variables
       [not found]         ` <aa5ef3ac-e5f7-4840-985a-68664a847ab1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-03-04 17:12           ` John MacFarlane
  0 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2015-03-04 17:12 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Ranjit Jhala [Mar 04 15 05:08 ]:

Alternatively,

     echo "" | pandoc --metadata body1="$(cat file1.md)" --metadata body2="($cat file2.md) --template=mytemplate.html -s


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-04 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04  4:02 Combine multiple files with multiple template variables Ranjit Jhala
     [not found] ` <07167e40-a024-4bf2-b874-4f4e790920f1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-03-04  5:46   ` John MacFarlane
     [not found]     ` <20150304054622.GA64297-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-03-04 13:08       ` Ranjit Jhala
     [not found]         ` <aa5ef3ac-e5f7-4840-985a-68664a847ab1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-03-04 17:12           ` John MacFarlane

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