public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jason Seeley' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Substitude a variable from a whole file
Date: Mon, 8 Dec 2014 13:51:37 -0800 (PST)	[thread overview]
Message-ID: <0ac81dad-2e2b-4953-ac88-10fcac837585@googlegroups.com> (raw)
In-Reply-To: <995bd994-b216-4742-8966-2926bc81e3f7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- 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 --]

      parent reply	other threads:[~2014-12-08 21:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 16:09 David Demelier
     [not found] ` <995bd994-b216-4742-8966-2926bc81e3f7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-12-08 21:51   ` 'Jason Seeley' via pandoc-discuss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ac81dad-2e2b-4953-ac88-10fcac837585@googlegroups.com \
    --to=pandoc-discuss-/jypxa39uh5tlh3mbocffw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).