From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23361 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Frederik Hartmann Newsgroups: gmane.text.pandoc Subject: Re: Can't access keys containing spaces in pandoc Date: Mon, 2 Sep 2019 13:19:05 -0700 (PDT) Message-ID: <7c15c170-1b08-4274-b24e-280b4585c0c6@googlegroups.com> 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: multipart/mixed; boundary="----=_Part_1564_130718848.1567455545263" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257991"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC3JHXELZMMBBOXSWXVQKGQEDTAW3KI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Sep 02 22:19:09 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i4sn6-0014x3-PT for gtp-pandoc-discuss@m.gmane.org; Mon, 02 Sep 2019 22:19:09 +0200 Original-Received: by mail-ot1-f55.google.com with SMTP id 100sf9345143oty.18 for ; Mon, 02 Sep 2019 13:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=aSL7XOaw2L6W3NGL7X1nvZpq6VmWIXEJwRXCsPO1Nh4=; b=mC0CKKCkixh7h6+Pp/aXyO3X16pdwhy9Gl1yxB65BX8m2eHr73CAzWfmfAmd6VrGO1 X6hidNqFglRYs5YY3K/geIjvHVP2orfd63bBEUxSYcnWQ+D5gy2Ozat+HRfpfdYlbTK4 dGoyeEpILxTrzj7rmfPV90Ms0Sb78o2nUSsJfyILK/nole0U/j5SPdWF3YZT+LgYCKGr P2XLRkcfPC2f7etWa+Ueu9h/Jgeq12Nzz/UikHTvI9hX6+cbdPdZnN/EZ7Wc7xGQGDYD 3/11DGicx4HeWASGkdigdfD6BtUl/It5lYxaRNnOJat1NVN/aVnwz9qdK58sxzu4j7Pg QM8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=aSL7XOaw2L6W3NGL7X1nvZpq6VmWIXEJwRXCsPO1Nh4=; b=GcFgNUi9XzDXXvnpTt0GF97IfFURURkDDOYMl6+dcBNDnQ0alBveeQROa0M2FvlBNv +r1icFXoBISMoSEGz+ZZkhjSYaEFZLIVEU/Lab49qOy6tqKnq7pnQMMRH1WIlBxysjJ9 txhQUbFvqtUG1qkCTmzLD7Elt0I6M9KI1bMDa96XuDQx4cKW9M9Mq9+YlXHZgP3xCDY7 vixETL14qxpRPmaSptAKEx2kaE/P3EgCc0MFdy54ycW8vmNjZg4gy4rAbc11uAMAZtuQ MBJ6WKyoXWYjG4KivEX9K9tfmECeFtAqFwCoZJYh64V3vyO2ozzpJrF1HKgKk4izzGGT 7g4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=aSL7XOaw2L6W3NGL7X1nvZpq6VmWIXEJwRXCsPO1Nh4=; b=Z7eOguuszNNTcvZxcnAvhRUYH86qVckSXA168JONcvCO16G+96oQJ1/bTWSuWVvwrl YsF1gNy/qfkM2bERbYnuKC979XU26nte2LF0pjVqAf0qofB53Bkx4O0b8uW6StYQCXWH iFkf5WI3uYcga40vY1PyXtaYU4lhIaaHXAwWphM3R18pym9QSxPe7tok/aJX/LDmsqUc fteEOiVu4dLky0L/+aimto3WK64zgpnusZ1VBisM7M4dckBWuoj7UDMBom7XwYAwU3X0 E7yjXfzadKMAVW/y/CVYU6AoZIspUaAZ8+TSYODzKLpoF44SZ6F0AyRV1foASgSKCRwX QRgg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVjQgHHK1EYZCY4/YF9zZCkNSTRKur0evUlOIJvMO61bc24WQCc hS59sX90+n0maN5XAZWQV9k= X-Google-Smtp-Source: APXvYqwUHzRjd0Uxz37J3WV49tWOVWxLxG4KwdLAMnlLVAZnwFx2y3M/14N29TUKuq496QXNhE8ISQ== X-Received: by 2002:a9d:37c7:: with SMTP id x65mr23454558otb.47.1567455547457; Mon, 02 Sep 2019 13:19:07 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:d703:: with SMTP id o3ls1391005oig.13.gmail; Mon, 02 Sep 2019 13:19:06 -0700 (PDT) X-Received: by 2002:aca:b989:: with SMTP id j131mr2010575oif.41.1567455546286; Mon, 02 Sep 2019 13:19:06 -0700 (PDT) In-Reply-To: X-Original-Sender: hecknar-Re5JQEeQqe8AvxtiuMwx3w@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:23361 Archived-At: ------=_Part_1564_130718848.1567455545263 Content-Type: multipart/alternative; boundary="----=_Part_1565_1910868400.1567455545264" ------=_Part_1565_1910868400.1567455545264 Content-Type: text/plain; charset="UTF-8" That's really not the answer I'd have hoped to hear... Do you know if a PR fixing this might be getting accepted? It's really limiting when perfectly valid yaml can't be used as template input. Thanks a lot though. Am Montag, 2. September 2019 19:28:41 UTC+2 schrieb John MacFarlane: > > > 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 > >> < > https://groups.google.com/d/msgid/pandoc-discuss/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com?utm_medium=email&utm_source=footer> > > >> . > >> > >> > > > > -- > > 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/68fbd484-0729-4ee2-a7a2-0846cd0bbd28%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/7c15c170-1b08-4274-b24e-280b4585c0c6%40googlegroups.com. ------=_Part_1565_1910868400.1567455545264 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That's really not the answer I'd have hoped to hea= r...

Do you know if a PR fixing this might be getting ac= cepted?
It's really limiting when perfectly valid yaml can= 9;t be used as template input.

Thanks a lot though.

Am= Montag, 2. September 2019 19:28:41 UTC+2 schrieb John MacFarlane:
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 <hec...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Yes, I tried this as well.
>
> $if(dependencies.external.hardware."Dependency On")= $\textbf{Dependency:} &=20
> $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=20
>> marks?
>>
>> Sent from my iPhone
>>
>> On 2 Sep 2019, at 10:10, Frederik Hartmann <hec...@gmail= .com <javascript:>>=20
>> wrote:
>>
>> Hi!
>>
>> We are using rather complicated templates to display certain i= nformation=20
>> about dependencies.
>> These information can be exported in yaml files and looks like= the=20
>> following:
>>
>> ---
>> dependencies:
>> =C2=A0 external:
>> =C2=A0 =C2=A0 hardware:
>> =C2=A0 =C2=A0 - Description: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Dependency On: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Date Required: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Dependency Owner: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Color: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Status: Text here....
>> =C2=A0 =C2=A0 =C2=A0 Last Updated: Text here....
>> =C2=A0 =C2=A0 =C2=A0 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=20
>> without having to specify them directly.
>> The next best thing would be if I could access them via the us= ual method:
>>
>> $for(dependencies.external.hardware)$
>> $if(dependencies.external.hardware.Description)$\textbf{<= wbr>Description:} &=20
>> $dependencies.external.hardware.Description$ \\ $endif$
>> $endfor$
>>
>>
>> The issue are with the keys that contain spaces. I can't f= ind a way to=20
>> access them at all.
>>
>> I tried it the following ways:
>> $if(dependencies.external.hardware.Dependency On)$
>> $if(dependencies.external.hardware.Dependency\ On)$
>>
>> Any suggestion?
>>
>> --=20
>> You received this message because you are subscribed to the Go= ogle Groups=20
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from = it, send an=20
>> email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>= ;.
>> To view this discussion on the web visit=20
>> https://groups.google.com/d/msgid/pandoc-discus= s/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com=20
>> <https://groups.google.com/d/msgid/pandoc-discuss/92055fd0-049b-4943-a51a-2eb0905b59ca%40googlegroups.com?utm_medium=3Dem= ail&utm_source=3Dfooter>
>> .
>>
>>
>
> --=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-...@googlegroups.com.
> To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/68fbd484-0729-4ee2-a7a2-0846cd0= bbd28%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/7c15c170-1b08-4274-b24e-280b4585c0c6%40googlegroups.co= m.
------=_Part_1565_1910868400.1567455545264-- ------=_Part_1564_130718848.1567455545263--