From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23360 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Can't access keys containing spaces in pandoc Date: Mon, 02 Sep 2019 10:28:25 -0700 Message-ID: References: <92055fd0-049b-4943-a51a-2eb0905b59ca@googlegroups.com> <5E6256F2-6354-43F9-9A49-2328471A9D2B@gmail.com> <68fbd484-0729-4ee2-a7a2-0846cd0bbd28@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100084"; mail-complaints-to="usenet@blaine.gmane.org" To: Frederik Hartmann , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBR5CWXVQKGQE2RNFHTY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Sep 02 19:28:42 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yw1-f61.google.com ([209.85.161.61]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i4q89-000PtV-4i for gtp-pandoc-discuss@m.gmane.org; Mon, 02 Sep 2019 19:28:41 +0200 Original-Received: by mail-yw1-f61.google.com with SMTP id k63sf11559599ywg.7 for ; Mon, 02 Sep 2019 10:28:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567445320; cv=pass; d=google.com; s=arc-20160816; b=XYqziqo/kPPHywJF4mc5ltpx+CSJlC/TJjnQ+va3QgIxZiALRFj2c6vnuRwCtK1upR WCZYLva3edN4anm/yIWYqZ3yCnSJsFIEk6CNOLzP/c1Y2yvPa/zyBk5mMbI+ZF3K8Y/r 6KgoFhfQF/w8EVs3AeLC1ihr8Wyl+K/bzB6+buaAgE0/wlFxXNi5VLgnO5W8feCJLnwA Tq7JValtheSPqTelDcpcyXw0KijaoEYkkD8fm9wCjhAZgGshjsXupXRfcCO/e63h0gOv du/TOkUa+8PmMJXWhTBRaP4y/VGSjoHOnicXs4zEir3kw51J0+9YJs6BhqNDB3I2fp2t BYOw== 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=y6OfXvur1k8kuRECPLtqywic+4nQd8BKy5odEdPRV2Q=; b=S9VkANuBMYJnoaBeLHhtWxviDCzJd7PYHoQYpoBOEvuq6bX0WqLKQ2HSuub11ogzVF 5SXS9eJS+fSTtEsSYSXlurW/jqsYMjn8jOvDhIC12SvVgPnTYArnb3TkN7breT3WTGVU IZaE/PBnq+1reMYU+VGckGwYSKynGf2by6sfq83XLUUbhn0PCUYNacoGKrLfMwj9hqFI iibJgGH35/+v9DLbds2oZfeOluaHjla/PmVOkrzob/tSugXxNPHmfIyijkSauJkQQAJg Zy3RqrowtP0tSs1f4M1JEANZTf88bLmTZCZni0XXCgAM2azqlLQrRnTOZwignPGeSOXS DaXQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=kREgPHQz; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42a 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=20161025; 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=y6OfXvur1k8kuRECPLtqywic+4nQd8BKy5odEdPRV2Q=; b=M9xRUPe01UeSP8q2+6fKHf2beeymh9MCLZTV/J0mXoIppJagqMCvBRQK6C2NWy47cc DVE9Wq8G17RMmWz9WX4Q43pIDAvKYyDgxdR6OLu/3SN5YVBN/NA2+PuQLdyT8eFkFcjX WFiVk/UFytPFMxnFEHpbCWbu3xaN1+6jn5kupvKzmtByN0/TA3fLmKJq0v1EXJnewQfb T4SmPkT7dTQ8iFUZjnv6DfBWAU9Hs2SI8Hw51GYPuEGaYraUovIOuQ5zmWUxF0iaCFSd YfnfDBTF5LGajJkgz4RLZvrDobXnuwKDvyxKkYrSMISbaM04wWm9DlyGUjpUsYwp+sW3 RmEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=y6OfXvur1k8kuRECPLtqywic+4nQd8BKy5odEdPRV2Q=; b=DD0o5KunEES9pMzFHmqw8/twak9eMWrN+U4E3VscD2hMUsPwBPJHt6GC+giiJjVFyi 9zmdrTkZ8goMWKuh1Na6H0b8VWE7sOAS3pHSdLTqdC15c1AL9Y8ZUUcT32GQgwnIgkEm mnirz5NCUUTqEviBnSzpKryh0Zshrwgu16ZZceNqFKIIHkJAy7w4jFEznfeG2jDTUXH7 2FuBCiUhXq/QOyAcakOXEFvnv16UO86X1xB0yrBYNbj16ufVX2sLEISPXEK0+DOmu7Cm bG9AMxIrBt2M/CBXxThyGtbCGebz3F/mp3gBJldo5qwJ+HKNKDD1YW7BCMPcaYOq19KE 4kgA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVVpfNFwXMkC+TRmv4hJ+p/g1M1rve3JMzMGXlK10/wYVr0g1o1 yZZV7skeJAkGfsSDu+XeHDI= X-Google-Smtp-Source: APXvYqyvcshEk6QvO4CqAsRMj6YGHd+LXy6RZvsl8hb6EL/aB4O/TsF1/YI04gME1PPi2Iln9PBEVw== X-Received: by 2002:a0d:d507:: with SMTP id x7mr20580900ywd.509.1567445319977; Mon, 02 Sep 2019 10:28:39 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a81:4c48:: with SMTP id z69ls1851209ywa.6.gmail; Mon, 02 Sep 2019 10:28:39 -0700 (PDT) X-Received: by 2002:a0d:ea06:: with SMTP id t6mr2097093ywe.116.1567445319309; Mon, 02 Sep 2019 10:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567445319; cv=none; d=google.com; s=arc-20160816; b=vepLbpmTby35ZZgiVRd5Rte7URQQ7fxacoy+aSmAlVh2KsIgbiDSKBzXx3mMyb2zhg eS4+8jcoddKv9Xjx1BdP4LpQirKv4/xum9pVLcpWkHE7kaMCzrUUtLME2OILHdgNJyPy zhGqY4IAqSw56EvltbXhSs7aTsNy8tbw/RbpMs7syqBCkFZtgtBpDNzuRVd5L7Dq4+Mn Ga6skCPcaPY7pjXmop+S38w2bVr8GOLYYnkvq9eGM5gI3FqztDiFUyUhhoD003YuMJYj u5BrfGjXriJjnnWLq7yEoMECcXlLSv7lxTmUs5y69LC15OnKoSZ82HXoV8vj1rZTWNDD QSvg== 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=g/gm5WIS0ucu+NDn5MKM1sp39RQXPgZGKhbYgoF2hPA=; b=sPX6CTLn3WY7dm0Yq1Ezw10oL2cpkcVLasxkdrXjEexS920tZXuRuVJ9R1jOYaGb+G fcccRwEXiCv+FbNrPvtZOFrjq5Ny7g7mCDIYDSbJDA2Jan+VBVPu88h9N0N6op+GFJLJ A0yHb7SoTZwh7T58Z211F4wyovW6bZafxwEXpiSfVxv2OMCM8g9aowQXRkXtuO07LO8a Iop0bvUmAegYgQfrU4uZeYMFubJQxfW1aHvy7wFqUCxm8jM3EdrjcIFEm4SEe1o0U/Uo sX8iwCFII/yhJvcF9Vp8CB3GRXkYeCJY7IzlecjW6Wd3yULvX5Kvt86od2TDMcjS+1jw iWTg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=kREgPHQz; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42a as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com. [2607:f8b0:4864:20::42a]) by gmr-mx.google.com with ESMTPS id g203si252350ywc.5.2019.09.02.10.28.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2019 10:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42a as permitted sender) client-ip=2607:f8b0:4864:20::42a; Original-Received: by mail-pf1-x42a.google.com with SMTP id y72so1700551pfb.12 for ; Mon, 02 Sep 2019 10:28:39 -0700 (PDT) X-Received: by 2002:a65:458d:: with SMTP id o13mr25714940pgq.34.1567445318450; Mon, 02 Sep 2019 10:28:38 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id ck8sm12517165pjb.25.2019.09.02.10.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 10:28:37 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id D8D95A16D; Mon, 2 Sep 2019 13:28:26 -0400 (EDT) In-Reply-To: <68fbd484-0729-4ee2-a7a2-0846cd0bbd28-/JYPxA39Uh5TLH3MbocFFw@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.20150623.gappssmtp.com header.s=20150623 header.b=kREgPHQz; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::42a 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.org gmane.text.pandoc:23360 Archived-At: In pandoc's templating system: Variable names must begin with a letter and can contain letters, numbers, _, -, and .. No spaces. One approach would be to use a lua filter to dynamically rename the metadata fields, converting spaces to _. You could then use _ in the template. Frederik Hartmann writes: > Yes, I tried this as well. > > $if(dependencies.external.hardware."Dependency On")$\textbf{Dependency:} & > $dependencies.external.hardware.dependency$ \\ $endif$ > > Causes the following error: > > unexpected "\"" > expecting letter > > In comparison, an unquoted regular blank causes this error: > > unexpected " " > expecting "." or ")$" > > > > > > Am Montag, 2. September 2019 11:37:45 UTC+2 schrieb James: >> >> Hi >> >> Have you tried enclosing the content containing spaces within quotation >> marks? >> >> Sent from my iPhone >> >> On 2 Sep 2019, at 10:10, Frederik Hartmann > >> wrote: >> >> Hi! >> >> We are using rather complicated templates to display certain information >> about dependencies. >> These information can be exported in yaml files and looks like the >> following: >> >> --- >> dependencies: >> external: >> hardware: >> - Description: Text here.... >> Dependency On: Text here.... >> Date Required: Text here.... >> Dependency Owner: Text here.... >> Color: Text here.... >> Status: Text here.... >> Last Updated: Text here.... >> State: Text here.... >> ... >> >> This is a perfectly valid and well-formed yaml document. >> >> Now, the best thing would be if I could simply loop over these attributes >> without having to specify them directly. >> The next best thing would be if I could access them via the usual method: >> >> $for(dependencies.external.hardware)$ >> $if(dependencies.external.hardware.Description)$\textbf{Description:} & >> $dependencies.external.hardware.Description$ \\ $endif$ >> $endfor$ >> >> >> The issue are with the keys that contain spaces. I can't find a way to >> access them at all. >> >> I tried it the following ways: >> $if(dependencies.external.hardware.Dependency On)$ >> $if(dependencies.external.hardware.Dependency\ On)$ >> >> Any suggestion? >> >> -- >> 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com >> >> . >> >> > > -- > 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/68fbd484-0729-4ee2-a7a2-0846cd0bbd28%40googlegroups.com.