public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MACFARLANE <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Automating markdown to odt with fields
Date: Tue, 26 Apr 2016 14:22:37 -0700	[thread overview]
Message-ID: <20160426212236.GA35686@protagoras.berkeley.edu> (raw)
In-Reply-To: <1a7138b7-aa6a-4873-b214-9644944c75c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

There are two things to fiddle with.  The --reference-odt,
which can help with style (spacing, margins, etc.), and
the opendocument template, which is a place to put hooks
for content.

You can create a custom opendocument template (use
'pandoc -D opendocument' to get the default one).

In place of $body$ you might have, for example,
$s1$, $s2$, and $s3$, perhaps with some content
intervening.

You can then use pandoc to fill these variables:

pandoc --template mycustom.opendocument main.md -o my.odt \
  -V s1=$(pandoc -f markdown -t opendocument s1.md)
  -V s2=$(pandoc -f markdown -t opendocument s2.md)
  -V s3=$(pandoc -f markdown -t opendocument s3.md)


+++ JDani Jiménez [Apr 26 16 13:58 ]:
>     Yes, you're right, maybe I was not clear enough. Let's go with a
>     better simpler try:
>
>   I would like to generate a odt template containing:
>    1. Structure: First page, spaces, between-paragraph distances,
>       margins...
>    2. Static objects: Static text, images...
>    3. Sections gaps (I guess vars in LibreOffice) placed where section
>       text should go.
>
>   This template will be the base of my documents. Well, once the template
>   is ready, I need to generate final doc with the dynamics text. What I
>   would like to do, and I don't know if it's possible, is to fill this
>   sections (t1, t2, t3) in my template with markdown. Why I want to use
>   markdown is to make possible to insert more than text in each section
>   (bold text, lists, links, images...). An idea could be having 3 files,
>   t1.md, t2.md and t3.md and use pandoc to fill the template like this:
>    1. render s1.md into s1 in the template
>    2. render s2.md into s2 in the template
>    3. render s3.md into s3 in the template
>
>   Ideally, I would like to insert a ToC at the begging. At this point, I
>   should have my odt generated.
>   Trying to clarify: Section number and possition is fixed.
>   Let's forget about git or automations... I'm experienced enough to do
>   that.
>   Thanks you all!
>
>   --
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/1a7138b7-aa6a-4873-
>   b214-9644944c75c6%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/1a7138b7-aa6a-4873-b214-9644944c75c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. 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/20160426212236.GA35686%40protagoras.berkeley.edu.
For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2016-04-26 21:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  6:43 JDani Jiménez
     [not found] ` <7608243e-3f15-48de-9230-00b78127246e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-26 10:07   ` BP Jonsson
2016-04-26 10:36   ` kurt.pfeifle via pandoc-discuss
     [not found]     ` <9a664450-8fbb-4a6d-abd5-5a4c567b2e69-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-26 10:46       ` kurt.pfeifle via pandoc-discuss
2016-04-26 20:58   ` JDani Jiménez
     [not found]     ` <1a7138b7-aa6a-4873-b214-9644944c75c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-26 21:05       ` JDani Jiménez
2016-04-26 21:22       ` John MACFARLANE [this message]
     [not found]         ` <20160426212236.GA35686-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
2016-04-26 21:42           ` JDani Jiménez
2016-04-27 12:00           ` JDani Jiménez
     [not found]             ` <59292504-c115-4935-b7e2-004c0c875289-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-27 17:21               ` John MacFarlane
     [not found]                 ` <20160427172120.GA40999-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-04-29  8:59                   ` JDani Jiménez

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=20160426212236.GA35686@protagoras.berkeley.edu \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=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).