From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29458 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Load additional meta-data from YAML file via YAML Block directive? Date: Wed, 03 Nov 2021 09:14:56 -0700 Message-ID: References: <35d6a2e0-7a32-40d9-a3bf-7fd945885d95n@googlegroups.com> <1EB7E01B-4F90-4E41-AFBB-19C1935D6038@zeitkraut.de> <87056507-2301-49C2-A061-C87ABF35F3C9@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20976"; mail-complaints-to="usenet@ciao.gmane.io" To: Martin Hepp , pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBK7LRKGAMGQEIETFLQY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 03 17:15:43 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f192.google.com ([209.85.215.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1miIvO-0005De-JI for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 03 Nov 2021 17:15:42 +0100 Original-Received: by mail-pg1-f192.google.com with SMTP id h10-20020a63df4a000000b002a6ba425b58sf1672539pgj.17 for ; Wed, 03 Nov 2021 09:15:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1635956141; cv=pass; d=google.com; s=arc-20160816; b=iaTm8aFjUjmaV6h92z3ac0mFHlfxH0b2Y25AnOi9eA6ENAWmhjcqRnIzGT4W63Ausx IgU28XKTRpsOtcBYVnbqcGBMVWdpERx1y6hVr1d9V8Pmnwxs4tL7tB43fhujBHtd/oBB LGP+xbkcZkKuwMYx7D4iOS1Na7DNfodQA5Hwp/xaF30Dt7OLjvzaBulY55ZUOfDArJb5 HA+SqiCzAZFsPtkf7UPP70vVNAGpN/8TYbjmwCfSGnpLi8igcZ8U0WZDmiQ1aI39CJtT ch1+7MOF87Rl0tyIK8AarSrcdsheVBm3JOPnMrpRayStpKMl+YetTxhTH3F+M1Zv7g6C M7Mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=cXnk/R6rGHjlfNbmp7DhLoyoE/ltZ1Yi4OMgOHvtdJE=; b=R3q8Iem6WrCY2IKgjaV01R3m32Lxac8wKyfGAPF5uKnqPu0mSBMuKqxVU3XdJrXR22 qcbcttxR5GmTU81MjBLjNzfwAy6tQ9td038QW+CPr7lOIT7zO5gI7zS/ZV0PdOaBrtQK jpursNLr267/xwpRTob9WaxrB33f0A9Rm6wx5SdYyHYcEd5WCz7HKB+tsfeHq/gmo8kh svQIhwqbFo/zd6yHeyOeDtnTOO/B0X3EcLTUQo3XQLV+zPAq3sQKgGX2rE4emAFk86vY AsdCGkn9NoKuMgoeeqki3RCo3WtxBIJXYOyWXyi3K7PJ90F2G8IxzIaG671Um1EJcgyX 8fbQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=4CI03c1i; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=cXnk/R6rGHjlfNbmp7DhLoyoE/ltZ1Yi4OMgOHvtdJE=; b=jiUG00EQ8JkzKCiroJTxBFdUxLLSi4wdaL8mag7stlGVDlnkGleT18GQiSal/7Hwc3 101UKNPAWszcaFDh9ucuwpdqFc86P1T8IDySgvGQACAHpLbPmyi3tcy5WXdR7ULDkIfQ EWM2XCVlgXMobeVmtQgiSx3mnfoyysMSSWry5hyGnabOY5pHLo6895fVoB0gaiSYNgSr ys0hVYK/BF6dwoSngDIgy203Im/9oCbR8GR+2njtJYmRRl9WpWt7Yuts+YvKmzG72wyr k6AKJgfBq3k47osastruojcIaYZ18OAV3eXPk9zCzoxxiGahAY8IVfNvK21vxE7omiD0 71lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=cXnk/R6rGHjlfNbmp7DhLoyoE/ltZ1Yi4OMgOHvtdJE=; b=Lg+ou6WUnjMcYGJYyoA7HwNo86cMqTBVje77E5FcF0/zIcomciYpKW7QOPT/qs/1e5 oKq+/RzczR+a8BooZ+uRNtXKamKrv6NL4/PNAQwtCfBcJm9C9aS+w7oflXQq+aB7DsG4 5kUp3IALVZhcPDQUzzlHhBqR8jKm26jmAiZ5q4OMJpKEhOoOkJ+cmXEnKFSd4t1wRKVB PAS3vl1WRnUntpWHoFBgz94XFabZ1wne/z/WN/D8OQ8QOgFUGoJSLlMm7vUhoOG8lznf 8WrU40vuzsY5sFvID/nVaKIXERJ2rzE35I/pZZT+JEpcBh1xqU4uoWH//6oan+8qF/dx gALA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533cAjE2hEXuOHIKTviAnPI0CBEolNeNuGURnx00ggV75wczrWD1 Pmv4tWoBVvPsOW+bLnPmTWo= X-Google-Smtp-Source: ABdhPJytktC3JJFW756Ha1e98A27An6TQqz8ZYBy1KX8mL3Xg/biukvGPu8bbNmbLS7Wk06Tc7A0yA== X-Received: by 2002:a17:90b:50c:: with SMTP id r12mr15440959pjz.71.1635956141385; Wed, 03 Nov 2021 09:15:41 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:1384:: with SMTP id t4ls1220556pfg.4.gmail; Wed, 03 Nov 2021 09:15:39 -0700 (PDT) X-Received: by 2002:a63:6c87:: with SMTP id h129mr17610447pgc.73.1635956139135; Wed, 03 Nov 2021 09:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635956139; cv=none; d=google.com; s=arc-20160816; b=WIpNdKZQdBHqoF/A9uzc9iIgn9UYqku1zJrXsSaYMF9xcg0m398p6lAtjjCu5N6Lt3 2wSXmMdEo01gaIW0n7dU723Mn076RPZXsGLXYu8dj9ibefYq5Ib6BPv7mi1i93hhHoQY BtqZHhDPrmafXpTJSanqPNvab8XwMLfMBjLLOdL7MrdeaoWdbzA+iQCHAyRySgXiAYnv AWPOEalbfjNZ4mt+qOVEwdmXukCZJ4KW+rZJN+OvHGwfXLl4hS2iJlGU7fBFpK9H2iEE NEfdavgzr6NN0cALaDcsJnxg8YdIOYzYw/2L3clBE6UOFjKIVM9E8Bj2VU5ihKba7fJN rktQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=jfGWjQznaNuf8AZg1ZbfnaJwqJoZ+zL4MZCVlxFzNNs=; b=NORDEKLqVkGu2eJOyIxGKcD8tJ0ll4OHR8MF11tOf9LkM85pUzbZqLe4X6LhpOgfVu r/i7CgTsQk+FKTnrF6ZlGRH7w1E66dc5+uCBcGVirtHEO8mu0iWEWbRfulrz4bJKhsa6 p7ktiMExQF93XvACy9u2lIQFdAKKJ+L/lFEIEes0F2ttGBgrBgGJdIxZtEnuxXlxH+KU UkuMkQ16BROpFeN9LtN0m4dmq9O1vrJj4cDsZylm6ytebrMDUwBUCl0EEYqbHTjfSdrN CqHeFeGozDaVwuIq5zM98xWuZp2YGXoALCY8FtXFKXGyDJwOwF/IupEmxbbnLH9Y7eOe 8hbQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=4CI03c1i; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com. [2607:f8b0:4864:20::62b]) by gmr-mx.google.com with ESMTPS id o2si579947pjj.1.2021.11.03.09.15.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Nov 2021 09:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) client-ip=2607:f8b0:4864:20::62b; Original-Received: by mail-pl1-x62b.google.com with SMTP id b13so2847072plg.2 for ; Wed, 03 Nov 2021 09:15:39 -0700 (PDT) X-Received: by 2002:a17:902:7c94:b0:13b:8d10:cc4f with SMTP id y20-20020a1709027c9400b0013b8d10cc4fmr39407309pll.54.1635956138538; Wed, 03 Nov 2021 09:15:38 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id m184sm2249159pga.40.2021.11.03.09.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 09:15:37 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 60CD9A24D; Wed, 3 Nov 2021 12:14:56 -0400 (EDT) In-Reply-To: <87056507-2301-49C2-A061-C87ABF35F3C9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20210112.gappssmtp.com header.s=20210112 header.b=4CI03c1i; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29458 Archived-At: Another possibility is to use --defaults with a defaults file that specifies the input file and all necessary parameters, including metadata. Martin Hepp 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.