public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Create multiple outputs from single defaults file
Date: Thu, 7 Oct 2021 10:07:18 +0200	[thread overview]
Message-ID: <CADAJKhBMDq22wSp0Z==AgxRf7e-b4M+xZpddv7UjA8_Z2kW2zw@mail.gmail.com> (raw)
In-Reply-To: <ba39e16b-6b2d-4bba-8e15-9cbdc7f23b95n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]

Den ons 6 okt. 2021 13:14Pranesh Prakash <the.solipsist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
> Dear all,
>
> Since pandoc can now reference multiple defaults files within a single
defaults file, I thought it would be possible to run a single command to
generate multiple outputs.

It isn't. Pandoc only ever produces a single output per run, unless
something has changed very recently.

>
>
> ```
>
> $ cat defaults.yaml
>
> ---
>
> # General options
>
> defaults:
>
> -  defaults/cis_ihrl_69a.defaults.yaml
>
> -  defaults/cis_ihrl_69a.html.defaults.yaml
>
> -  defaults/cis_ihrl_69a.pdf.defaults.yaml
>
> ...
>
> ```
>
>
> The files `cis_ihrl_69a.html.defaults.yaml` and
`cis_ihrl_69a.pdf.defaults.yaml` have different `to:` lines.  I'd expect
both an HTML output as well as a PDF output when I do:

You can invert the pattern by having a file, say `common.yaml`, which
contains the settings common to HTML and PDF output and include it from
`html.yaml` and `pdf.yaml`:

``````yaml
to: html
defaults:
  - common.yaml
``````

``````yaml
to: latex
pdf-engine: xelatex
defaults:
  - common.yaml
``````

Then you can use a Makefile to run pandoc once for each output with each
defaults file:
(watch out for spaces where there should be tabs!)

``````make
all: document.html document.pdf

.PHONY: all

document.html: document.md html.yaml common.yaml
pandoc -d html.yaml $< -o $@

document.pdf: document.md pdf.yaml common.yaml
pandoc -d pdf.yaml $< -o $@
``````

Still nicer than including a loooong command line in the Makefile!

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBMDq22wSp0Z%3D%3DAgxRf7e-b4M%2BxZpddv7UjA8_Z2kW2zw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3977 bytes --]

  parent reply	other threads:[~2021-10-07  8:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 11:13 Pranesh Prakash
     [not found] ` <ba39e16b-6b2d-4bba-8e15-9cbdc7f23b95n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-07  8:07   ` BPJ [this message]
     [not found]     ` <CADAJKhBMDq22wSp0Z==AgxRf7e-b4M+xZpddv7UjA8_Z2kW2zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-07 11:37       ` Pranesh Prakash
     [not found]         ` <7a342f8f-63d7-45d0-9a5d-8e820cae1826n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-07 12:28           ` Joost Kremers
2021-10-07 15:12           ` BPJ

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='CADAJKhBMDq22wSp0Z==AgxRf7e-b4M+xZpddv7UjA8_Z2kW2zw@mail.gmail.com' \
    --to=melroch-re5jqeeqqe8avxtiumwx3w@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).