public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Martin Hepp <mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Load additional meta-data from YAML file via YAML Block directive?
Date: Wed, 03 Nov 2021 09:14:56 -0700	[thread overview]
Message-ID: <m2r1bxqkqn.fsf@Johns-Air.hsd1.ca.comcast.net> (raw)
In-Reply-To: <87056507-2301-49C2-A061-C87ABF35F3C9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Another possibility is to use --defaults with a defaults file
that specifies the input file and all necessary parameters,
including metadata.

Martin Hepp <mfhepp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Dear all:
>
> I am trying to build a cleanly organized environment for deriving slides, reports, papers, lecture notes etc. centered on Pandoc.
>
> In order to avoid redundancy and hence ease maintenance etc., it would be good to put different groups of meta-data into different places:
>
> a) _user_ meta-data (like the default path for the BIB file, the author name, ...)
>
> Example: my-meta-data.yaml
> ---
> author: Martin Hepp
> bibliography: my_references.json
> ...
>
> b) output format-dependent meta-data defaults (one file for e.g. Beamer slides, one for Eisvogel reports, one for LNCS papers, ...)
>
> Example: eisvogel-defaults.yaml
> ---
> toc-own-page: true
> ...
>
> c) output format-dependent meta-data for specific renderings (e.g. logos for multiple institutes or if a research project requires specific colors or texts)
>
> Example: eisvogel-project1.yaml
> ---
> titlepage-text-color: "000000"
> titlepage-rule-color: "00A19B"
> titlepage-rule-height: 15
> titlepage-background: "background-project1.pdf"
> logo: "templates/static/logo1.pdf"
> logo-width: 10cm
> ...
>
> d) document-specific meta-data in the YAML header block of the actual document 
> Example: my-report.md
> ---
> title: Pandoc is simply great
> ...
>
> < Actual content goes here>
>
>
> Now, the details from c) (like the logo path, colors, and the footer texts) should be referenced in the document d), not repeated, like so:
>
>
> Example: my-report.md
> ---
> title: Pandoc is simply great
> include-metadata-from: eisvogel-project1.yaml
> ...
>
> I am using --metadata-file to load the various defaults in their order of priority. But the settings from c) should be ideally set by referencing c) in the actual document d).
>
>
> My question: Is that possible with Pandoc's included batteries?
>
> Currently, I see only two options:
>
> 1. Add the file-name of c) to the list of input files, like
>
> $ pandoc my-report.md eisvogel-project1.yaml -o my-report.pdf --metadata-file=my-meta-data.yaml --metadata-file=eisvogel-defaults.yaml
>
> 2. Use https://github.com/DCsunset/pandoc-include, which allows including YAML files in the YAML header block, like so
>
> ---
> title: Title
> ---
>
> !include-header header.yaml
>
> # Section
>
> Body
>
> See https://github.com/DCsunset/pandoc-include#header-include
>
> But I hesitate to add a hard dependency to #2.
>
> Thanks for your help!
>
> Best wishes
> Martin
>
>
>
> -- 
> 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/87056507-2301-49C2-A061-C87ABF35F3C9%40gmail.com.


  parent reply	other threads:[~2021-11-03 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 16:56 Beamer in pandoc fdq0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found] ` <35d6a2e0-7a32-40d9-a3bf-7fd945885d95n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-02 18:33   ` Albert Krewinkel
     [not found]     ` <1EB7E01B-4F90-4E41-AFBB-19C1935D6038-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-11-03  0:26       ` Load additional meta-data from YAML file via YAML Block directive? Martin Hepp
     [not found]         ` <87056507-2301-49C2-A061-C87ABF35F3C9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-11-03 16:14           ` John MacFarlane [this message]
     [not found]             ` <m2r1bxqkqn.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-11-04 15:49               ` mfhepp
2021-11-04 17:54       ` Martin Hepp
     [not found]         ` <A948BA78-4BA9-4D58-9850-E59C25C2F5E7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-11-04 19:32           ` Martin Hepp

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=m2r1bxqkqn.fsf@Johns-Air.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=mfhepp-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).