public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Substitude a variable from a whole file
@ 2014-12-08 16:09 David Demelier
       [not found] ` <995bd994-b216-4742-8966-2926bc81e3f7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: David Demelier @ 2014-12-08 16:09 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Hello,

I'm wondering if there is a way to substitute a variable from a file so 
that you can make large templates / layouts like this:

$header$

$body$

$content$

$footer$

And then pandoc ... header=header.txt body=body.txt and such.

The option -V is nice but for embedding large content it can break the 
command line invocation IMHO.

What about something like --variable-file and --metadata-file options?

Regards,
David.

-- 
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/995bd994-b216-4742-8966-2926bc81e3f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Substitude a variable from a whole file
       [not found] ` <995bd994-b216-4742-8966-2926bc81e3f7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2014-12-08 21:51   ` 'Jason Seeley' via pandoc-discuss
  0 siblings, 0 replies; 2+ messages in thread
From: 'Jason Seeley' via pandoc-discuss @ 2014-12-08 21:51 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

This sounds like a job for a file preprocessor or template processor. I use 
filepp, myself, but there are others (gpp, the C preprocessor, and template 
processors like Mako, Jinja, etc.). Any of those have some variation on 
"#include 'body.txt'", so you can build your file from different parts. 
Depending on what works best for your files, you could pipe the output of 
the preprocessor to Pandoc, or the other way around. 

On Monday, December 8, 2014 10:09:22 AM UTC-6, David Demelier wrote:
>
> Hello,
>
> I'm wondering if there is a way to substitute a variable from a file so 
> that you can make large templates / layouts like this:
>
> $header$
>
> $body$
>
> $content$
>
> $footer$
>
> And then pandoc ... header=header.txt body=body.txt and such.
>
> The option -V is nice but for embedding large content it can break the 
> command line invocation IMHO.
>
> What about something like --variable-file and --metadata-file options?
>
> Regards,
> David.
>

-- 
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/0ac81dad-2e2b-4953-ac88-10fcac837585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

end of thread, other threads:[~2014-12-08 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 16:09 Substitude a variable from a whole file David Demelier
     [not found] ` <995bd994-b216-4742-8966-2926bc81e3f7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-12-08 21:51   ` 'Jason Seeley' via pandoc-discuss

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