public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Each YAML block is a YAML document?
Date: Fri, 13 Aug 2021 11:51:28 +0100	[thread overview]
Message-ID: <CAEe_xxhdOH1XXJJ3gZBNz+80XZ6XG=h1W9K0qCk2mTModpd9Hg@mail.gmail.com> (raw)

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

I was trying to use YAML anchors to avoid some duplication. This works:

---

buttons-base:

- &home-button

  label: Home

  url: 'https://www.example.com'


buttons:

- *home-button

- label: Extra

  url: 'https://extra.example.com'

...

but if I split it into two separate YAML blocks the second block isn't
parsed as YAML. (In the real world, I want the first definition, which
would define several YAML anchors, to be in a separate shared YAML file.)

I'm pretty sure that this is because each YAML block is (in YAML-speak) a
separate YAML document, so I should never have expected this to work. If
so, perhaps the manual could clarify this? However, just in case there's a
way of sharing some context between YAML blocks, I thought I'd mention it
here before creating a GH issue.

Thanks!

-- 
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/CAEe_xxhdOH1XXJJ3gZBNz%2B80XZ6XG%3Dh1W9K0qCk2mTModpd9Hg%40mail.gmail.com.

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

             reply	other threads:[~2021-08-13 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 10:51 William Lupton [this message]
     [not found] ` <CAEe_xxhdOH1XXJJ3gZBNz+80XZ6XG=h1W9K0qCk2mTModpd9Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-13 14:45   ` 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='CAEe_xxhdOH1XXJJ3gZBNz+80XZ6XG=h1W9K0qCk2mTModpd9Hg@mail.gmail.com' \
    --to=wlupton-qst+ys/numyeuisrzh9sikb+6bgklq7r@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).