public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Multiple YAML metablocks with the same key
Date: Sat, 19 Oct 2019 13:24:25 +0200	[thread overview]
Message-ID: <CADAJKhAmjTgOsDcWuVdnXzOEHp5=eOe6hKS_+uzGRD6DeCUurA@mail.gmail.com> (raw)
In-Reply-To: <b5cc6a0f-cac7-4e0a-860c-b3ef2878cd0f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

Yes, that is correct. You may be interested in my Perl script which
recursively merges data structures in a "smart" way:

1.  If both structures are hashes (mappings/dictionaries) they are merged,
with the values of identical keys merged recursively.

2.  If either structure is an array they are concatenated, with the
structure which isn't an array, if any, prepended or appended to the one
which is.

3.  In all other cases the structure "to the right" is preserved at the
expense of the other one.


Den lör 19 okt. 2019 12:20Patrick Kenny <ptmkenny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> In the section on Metadata blocks, the manual
> <https://pandoc.org/MANUAL.html> says this:
>
> A document may contain multiple metadata blocks. The metadata fields will
>> be combined through a left-biased union: if two metadata blocks attempt to
>> set the same field, the value from the first block will be taken.
>
>
> I have two metadata blocks, all of which look something like this:
>
> Block A
> link:
>   yahoo: "www.yahoo.com"
>
>
> Block B
> link:
>   google: "www.google.com"
>
> So the root key is the same, bu the sub keys all have different values.
> In this case, Pandoc only recognizes "yahoo" in this case because that's
> the first block... is my understanding correct?
>
> I tested this and it seems to be the case, but I just want to make sure
> before I try to invent some way to combine my disparate YAML files...
>
> --
> 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/b5cc6a0f-cac7-4e0a-860c-b3ef2878cd0f%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/b5cc6a0f-cac7-4e0a-860c-b3ef2878cd0f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CADAJKhAmjTgOsDcWuVdnXzOEHp5%3DeOe6hKS_%2BuzGRD6DeCUurA%40mail.gmail.com.

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

  parent reply	other threads:[~2019-10-19 11:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19 10:19 Patrick Kenny
     [not found] ` <b5cc6a0f-cac7-4e0a-860c-b3ef2878cd0f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-19 11:24   ` BPJ [this message]
     [not found]     ` <CADAJKhAmjTgOsDcWuVdnXzOEHp5=eOe6hKS_+uzGRD6DeCUurA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-19 17:13       ` Patrick Kenny
     [not found]         ` <8ce4df9d-4c43-40bb-a759-1cb509090ca3-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-19 17:32           ` 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='CADAJKhAmjTgOsDcWuVdnXzOEHp5=eOe6hKS_+uzGRD6DeCUurA@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).