public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: K4zuki
	<k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: FEEDBACK WANTED: Re: YAML metadata files' override order in a single command line
Date: Wed, 02 Oct 2019 11:48:18 -0700	[thread overview]
Message-ID: <yh480keezv0yrx.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <2921e399-c659-4cba-9357-577c2b05aece-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


It is as you discovered: the first one wins, currently.
This is somewhat arbitrary and could be changed.

Using foldl1 instead of foldr1 in line 230 of Text.Pandoc.App
would give the other behavior.

The change allowing multiple metadata files is not yet in
any released version, so it would be easy to change this.
I'd welcome feedback from people.

consistency is good, so we should also ask:

- which takes precedence if you do
  --metadata foo=1 --metadata foo=2
  on the command line?

- which takes precedence if you have two YAML metadata blocks
  in a markdown file, and they set the same field?

K4zuki <k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello,
>
> I have a question regarding multiple yaml input in one command line.
>
> I have two yaml metadata files: system/config.yaml and user/config.yaml. 
> They have some overlaps in entries.
> I tested the following command with expectation that user/config.yaml 
> overrides system/config.yaml:
>
> pandoc -s -t markdown system/config.yaml user/config.yaml
>
>
> but in fact system/config.yaml wins. What system/config.yaml does not have 
> is merged as expected (and vice versa).
>
> So the question is when multiple yaml with entry overlap given in a single 
> command line, what kind of override order is applied?
>
> Thanks && Regards,
> Kazuki


  parent reply	other threads:[~2019-10-02 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 16:59 K4zuki
     [not found] ` <2921e399-c659-4cba-9357-577c2b05aece-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-02 18:48   ` John MacFarlane [this message]
     [not found]     ` <yh480keezv0yrx.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-10-02 19:45       ` FEEDBACK WANTED: " BPJ
     [not found]         ` <4998a075-0f70-4b30-7406-135d2e160b97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-10-02 21:00           ` Gareth Stockwell
2019-10-03  0:04           ` John MacFarlane

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=yh480keezv0yrx.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=k.yamamoto.08136891-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).