From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33009 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Setting a template based on YAML metadata blocks Date: Wed, 2 Aug 2023 10:23:49 -0600 Message-ID: <6CAC3AED-3628-4F25-BBB9-D3CEA9CECA36@gmail.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7334"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBGMGVKTAMGQEIYC33RI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Aug 02 18:23:56 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qv1-f61.google.com ([209.85.219.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qREdg-0001k8-PK for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 02 Aug 2023 18:23:56 +0200 Original-Received: by mail-qv1-f61.google.com with SMTP id 6a1803df08f44-63cf5bb17c6sf125866d6.0 for ; Wed, 02 Aug 2023 09:23:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690993436; cv=pass; d=google.com; s=arc-20160816; b=wqvF68A/c9ZheePTMCfZ/mbCRzqnnNZEy96n4wCdLBde5090GMrw+9liBYrMSZetPL AgLG9x6+nNUlDgZEAeN7fFdy903+74oRoauLLIswpDlfXVv2dHHMTo+L0mpSVo91qn75 XVinS0IV01rb2GRpjjwnduYmuNfNG4IAabt8JdR2oRkIxMgQw+muEKhvFbeeKC6w5N/4 l5s1fsvjLT9ylxhhQzCRofL6xiKxUf/+6yyV9Iy3yMZPBYwSYpt6jRj13ca2OAie70NJ 41FULBD46YHqn+DUfY7IQCcdf7f5OMiQcBnp2uiEHb+Jj2y1DEwJizKgIkGaCyXlcOsC aGZg== 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:message-id:in-reply-to:to :references:date:subject:mime-version:content-transfer-encoding:from :sender:dkim-signature:dkim-signature; bh=7pFOCMUQ1EsC+VW3hso2vGqPXmXtM9LTNT57iYGIZXQ=; fh=A7KGSvm30SBY9b2v+N53j+lkchMNZtkZbRzF4WqsV70=; b=Covrq4aWbUoOQhBRO8GEFiiJ0V7qKd5sTI1vd2geLlADGV8tAsRkG9BGN3051ivn7L kVj7uJQYg8SF0w8jAvCNAO3lcTQcZ+1kQ4f/t62FkqE3YlQERUmnSlo4cP29IYriUi2/ TdRYkPLu0/5xasw6ebN+xU+hSI45hcFP5848gBpgg3qxk7Tj6O8SGKsKTG9a6IIMiTRV uYlU16he9YrjWYKuiHBSdxsCylnm2U+q1WCIjLkh38ikBHxFmCS6434ZYOQThmdCA0zJ 65P7WAuFDeK0YyUoVdr3nxatWGQxTSuWMT4JpoZcULDtDh+GQnt5DOmahyKjO+qCY2YM hshA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oLsVWbNP; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1690993436; x=1691598236; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=7pFOCMUQ1EsC+VW3hso2vGqPXmXtM9LTNT57iYGIZXQ=; b=bVJZg8LgDDyhtVcgQF+hrKsIoCkg8XOlvwRCwThcYUOE6QbaHH7VYt89PWMAPCteMn JJexAIkI8FwZ3m18aGGf2WRPEPw6RF5uCZgtRkJCe9NBrtlTQKNTWkB9c2aPAM4rpmRQ 1h5sDnMGBA6k2Ym6fYiE2Ma73oqnoYTWRLf6KzMkfCY2rLGSsL394g9f2dQUUprBNL16 o5qFDRJmSlCRIZfgb5q3HrFRxwdqWmI+w5j+mnkzuokbtXmIdwIsUPezj+Eq4NDqRhKd KdPRZTYYW7Hv0PVgHDF/ul5AQ82sPsndWrNkZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690993436; x=1691598236; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=7pFOCMUQ1EsC+VW3hso2vGqPXmXtM9LTNT57iYGIZXQ=; b=bUalKh2BuAy+LuSpMe3NE7Y5w6dxA04Iae/i5WXc3/xGlu9YcuSYK5Z8/0IC5M/7vK 5mLpGGfY3b+CFIwn4CVEsavFphoWS6Y37V9sQqP/uPVmeKs6lo5bZnKgnT262gEZYvq9 T0cG/L0Mjl0FpYwrUg2kTk8qVzPzdMbcq7hU/SPNxfdIRkvu5p7s4hqYWHhSJX8SLOhI fmMawRpUtvsJioXr8M/GJ5aLGrrg2LQqL0LPmXmZuxFaU4EFLh3DA/4etFUkBM6utitB Jrhfo8DuqNkb6rpUOAQB0BlSvYW61yRdnUCji3ZiYTQuDW0NhO1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690993436; x=1691598236; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=7pFOCMUQ1EsC+VW3hso2vGqPXmXtM9LTNT57iYGIZXQ=; b=iE+ZL7IncouHhPN2uAvvrXg/kyJ4bWsE7lIO/8tw+p6vievsd2DRE8HXGqUI+e2DWg 4asaCgYbooQUBaN93Bj3liIPoMewOLUSHWo8B6hnMJQBQ4YStgk4yVzNJvdFJzH6frAJ lUS0aBVxrIIyqbHsYTkO2p+ZkiYGhQJLgiHaZEChyKGFEYF2GPTRf+7yuPy2nuF36ppM J2MxFpXSF3PKA0Kci7bz6vB+RXpvfZl482JC1fTm1t3SvNHkrgyBNn+GXA Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLYvgS5c0fj7NZcUDXNRy6M2q6cmf+ZzKzBQAJSwdSz36KAMTc6k C+DQCwnKCvATlQFqEiyNkag= X-Google-Smtp-Source: APBJJlHvtNa1MbRmSTybWsjMH4m3pnm/Qh+wDniwvMcT0Re2a5mVV3z84F9TyvUptedCTYsgCKvscg== X-Received: by 2002:a0c:e38a:0:b0:630:463:3650 with SMTP id a10-20020a0ce38a000000b0063004633650mr18280383qvl.39.1690993435812; Wed, 02 Aug 2023 09:23:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a0c:e0cc:0:b0:635:fc62:a34f with SMTP id x12-20020a0ce0cc000000b00635fc62a34fls7355026qvk.0.-pod-prod-07-us; Wed, 02 Aug 2023 09:23:52 -0700 (PDT) X-Received: by 2002:a1f:5f97:0:b0:481:521f:b704 with SMTP id t145-20020a1f5f97000000b00481521fb704mr5747194vkb.9.1690993432360; Wed, 02 Aug 2023 09:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690993432; cv=none; d=google.com; s=arc-20160816; b=Wp6kY/b9f6XdHmbLv/HuaDH4qZr3ZLZuA1OFBWEJMSt+jViVdeQmYSd/hhn0tPJD1h B1A8O44m+6d93etBkWrgsv+GmoXtvsaSeicvAZ+x+2ZR+XmbXLez0BWoOvq5GGlNlu0T i5t5fgOjdNjJKJeLKMfGphz9GLWdQ6H3dle2GPPfbN4FEUmijtjBJLSZIzFj5DMn8eh4 0ZvSh4jpXOAZNNhviHiJWTuiGjdGe5dnEZD0bmNnzLt10FLV8yFzKdqYfd3iLVv8HDE1 N9ayTuYVQVf1BB7NzZABJiFRmdPHnkrcia95MrCIyCi5g7D3+zkYZfPdj5Jn8YR1KBy4 LwDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=dYH1FqYR3n23bxkGbcDhgmvYHKMoYwqgYrQAC8uh/Uk=; fh=A7KGSvm30SBY9b2v+N53j+lkchMNZtkZbRzF4WqsV70=; b=W5MSzLZ8vFkeigxqfTIQj2U1TCdM/plCZbh+LsjwTxKwuMvR+RGZQGN4pu6/VgzoXN uzFaT05TCobmU2HuT8+cbguJmTDIyRcG3ocQQx4itQYylhVfxrhc41+1LqZUmAfZhaPa BFhoy3/ORzcIHfCKLkgf0TKIh8bxKyerZvx7tjroVSVVIW03yu9nxf/sDBcQUxz/4hME lDojeD7Nduil7v2eyF2o7ytQe+yTPEpeMfesREolNiPJ/sKJeErlT7GaLed5wTQnARCh qVYT2DKewVUKVu4Juek0pT5ymcD6cTGcU/MYW9e/kENON68iA6XNNXQfn1LunZgYzFcM JyFA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oLsVWbNP; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 l203-20020a1fa2d4000000b004864d2cad2asi1687134vke.5.2023.08.02.09.23.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 09:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@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 d9443c01a7336-1bbff6b2679so312915ad.1 for ; Wed, 02 Aug 2023 09:23:52 -0700 (PDT) X-Received: by 2002:a17:902:e744:b0:1bc:1df2:4c07 with SMTP id p4-20020a170902e74400b001bc1df24c07mr6146168plf.63.1690993431499; Wed, 02 Aug 2023 09:23:51 -0700 (PDT) Original-Received: from smtpclient.apple ([2607:f140:800:1::407]) by smtp.gmail.com with ESMTPSA id p16-20020a170902e75000b001b9fef7f454sm12573060plf.73.2023.08.02.09.23.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2023 09:23:50 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oLsVWbNP; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:33009 Archived-At: > On Aug 1, 2023, at 11:16 PM, JJ wrote: >=20 > Hello, I've been acquainting myself with pandoc for the past few days. > It's quite neat. I particularly do like pandoc's markdown flavour: > it's everything I've ever wanted out of such an extension! I had some > questions that I've been unable to find answers to in the manpage or > elsewhere, however. >=20 > Is it possible to specify a template that pandoc is to use in a YAML > metadata block? Presumably this would only work with --standalone. > I've attempted `template: ` after seeing it elsewhere and hoping it > may work, but no dice. This seems like a common enough use case that > I'd imagine there is an option I am missing: or perhaps people on this > mailing list have external solutions. (though I was hoping to avoid > the use of sed: for no reason other than I've only had to use pandoc > in my script so far, which has been quite neat) No. You can use a defaults file for this. We try to separate metadata fro= m processing instructions. > Also, what is best practice for "including" HTML fragments in pandoc? > I've found nothing in pandoc for this purpose so far - which, well, > makes a lot of sense. I was planning on first trying to rework things > to rely entirely on templates, and then in the event of failure just > sed-ing it up. But I harbour some concerns about accidentally > replacing text strings or code blocks. I'd need more information about what exactly you're trying to do. In the t= emplate, you could include a variable and then populate it from a file usin= g --variable myvar=3D$(cat myfile.html). In the document itself, there's no= built-in way to do this, but you could use a small Lua filter to replace s= ome element of the text (say, a code block marked with the file name to be = included) with raw HTML from a file, which would be passed on unmolested to= the output. > Also also I am curious: what is the background behind *default* html > templates needing the .html5 extension, but regular html templates > using .html? This threw me for a bit of a loop for a bit. html4 and html5 are separate output formats (but `html` defaults to `html5`= ). That's why. The templates are a bit different. > -- JJ >=20 > --=20 > 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/msgi= d/pandoc-discuss/CABHcm%3Dpt_xyOKPCvieJH-QNvArZnCosb_h7xp4g_0RNJ0EECgQ%40ma= il.gmail.com. --=20 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 e= mail 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/6CAC3AED-3628-4F25-BBB9-D3CEA9CECA36%40gmail.com.