From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32143 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Use a pipe to generate only first word of a variable? Date: Sat, 4 Feb 2023 10:29:36 +0000 Message-ID: References: <074330dd-ae01-4471-9550-ea09b2fe7363n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 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="30141"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBFPH7CPAMGQEFFBYNMY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Feb 04 11:29:45 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f61.google.com ([209.85.128.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pOFnk-0007gJ-K1 for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 04 Feb 2023 11:29:44 +0100 Original-Received: by mail-wm1-f61.google.com with SMTP id fl9-20020a05600c0b8900b003dfe4bae099sf2662230wmb.0 for ; Sat, 04 Feb 2023 02:29:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675506584; cv=pass; d=google.com; s=arc-20160816; b=h4011lUQ3++8juP9rqx5wthJ7BeNpmdi/eujiYOmQWBRLvQlFYEnrUzFFr7ktLMJ62 MzHbroqoq0mSL0hssfhlagdWbriLHCEq8O1peBmDnaBqpvZl6i/LnogyafMUTjz7Ne+P BHfSnGHwRg0QotxCSuxjk/P9w5CtsK3vgSiXGePR0qsIH/+UoJLiFcALFojYiv8pKjov DzqlWLTx1OND7RH2TxoGqmX32QN09jTpvetdsCB4QwRrk8GdKnznEikhuc2J+MXX47QV e1hfZk2Lk4ojgGh1Wj2rE+4+U40ApnCdeKC7pvEJ1j1C/4a/toPMLa4/8uMDjgtck4Kt WEGg== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=B2Z6htyX8tph/3TI39h94iMoW8yWGtmiRLC2kREZyQo=; b=nfL9d4QwV94uCYUhuQkZnpHbGXkt/tFsuNAna/8evZCLvrjSs8Mpbs1gLNmwm068/3 mvgbdzWpmTPQerpEZv1DtZH7cybILLbyjj0aQ+QrGEYgc240rS8ZmRLHlU4/dpaEhoNm BdFLMEsNkBpwDbq1xi0XAmOnGeboo267P3sEyiFTeOomG1Hzu/cJjGOwcn0dcwwZ26uB jW2KawW4MZLOT5R4U9aIjcAr2S21lFviKKtj8CLFiFvIar2gBb4p/KnPezOZ8hHmhgsz xnQiy1NsSppk+yVMmMQznIxX7FUDeuXEzlrrpp9rnM/H5/Bh/ODHDbCik6+NSOYPDoMJ 2UCQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=IPQ1SSMb; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=B2Z6htyX8tph/3TI39h94iMoW8yWGtmiRLC2kREZyQo=; b=h4o4rKGRPfeqomPoCGobJOoFBu8bc4trVhYcd+1Q14Lhu0n+h242vr9KSCkxiWjUsy mOmP4zSMBMI2zLXlAYeoXv4L3zpB6Mu9nsLMLqdCEoVcHANxfJ/p6BKYcgqspDkP9Azf yS+jUT+AcQ0G7m4cqGp3a5QlJqOZF7+e74Uxv2cuMq+iyvEzASHWoCg7d58C0JHSKX1w s+Ct18Q4fHSCS83Ohs8kU1UA5GWpuWjkQTqL9dhSCztoi+BVCqY0KKOHBpBwze9Ebins puySKAMq7ge2s+VO6j56dAYlmFseSZO7UlvgmVmCOByPl X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=B2Z6htyX8tph/3TI39h94iMoW8yWGtmiRLC2kREZyQo=; b=x2vhWxHlHdICqSYE1cIGhyUFCbuo8hB/BFuSTgpnyYJPM11YJ9QtXiuZvN1daj0tBN 7o6tj8qD/NRS6Qhjhb5/YL9uOVzAU+1jaCjIUhSfP8YFHBSRO06mJaq0akADG4HRawj+ tJenPvPM5AuNjPfkbw09E6u1ptLoM6+DpJ9wNNNDCIz+3bjll5X/cajZIGIWsmxtMzPi Xxmq1v/tsCxCnwly6payZaodjIPaLzE8DlrPT68xIlJOM7mtHjGJiY48PsoPkl7J1ANA Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKVVarTFKssD2MKFOE40d4/9KPMSN/DvfO8WzxlSfvnZpEGkEXi7 m1IIAliGBbSbsgiQh9MFWdQ= X-Google-Smtp-Source: AK7set9h0FkNGc+/3ke2Lu7at08Gzy/Iwr4RptBeNzZB+gOO6C/kVZg/a9nYbPPFkvqrtNA/25iouw== X-Received: by 2002:a05:600c:2050:b0:3df:a04a:1b5 with SMTP id p16-20020a05600c205000b003dfa04a01b5mr944090wmg.88.1675506584078; Sat, 04 Feb 2023 02:29:44 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5d:6f0a:0:b0:2bf:ccef:53a6 with SMTP id ay10-20020a5d6f0a000000b002bfccef53a6ls10357055wrb.0.-pod-prod-gmail; Sat, 04 Feb 2023 02:29:40 -0800 (PST) X-Received: by 2002:a5d:5949:0:b0:2bf:e528:336b with SMTP id e9-20020a5d5949000000b002bfe528336bmr10518934wri.38.1675506580273; Sat, 04 Feb 2023 02:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675506580; cv=none; d=google.com; s=arc-20160816; b=zS5kApB5prgmgJIIvEAyXmWEGQExR6z8PNYpXAWdtNnxXo62CvSEdMB/1h+4H9G9Lg prJ+DSy0ZPdDiTgIugG91Zmpe0YWYgPJzqjck/3ISRqePMjlDUxKYKj31IAhWQMyV2Fl iqpxDIzryrGXjj8lDvDLU/04avpPj2d+Wkixn2FWkJbHr/w3vJW0kuoe3daLLASuw931 PMsc+/qt23jEWWX5QN+tfqyN4n2fyFEARwoxOuIB2GPMY5RIM4phg6BVGLQz0r/V9K/8 cTqcgwgzs2NV242bz+lvHtBu7ZdxWm+cinaobhUtM+nVsOq9anrLwD4f61h3XzvIxg6Z bNYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=wW7EjEPjfIZuZwQOQ4/Gob8fJkzVoodJ0qQShE7jWIU=; b=PCUBvnXPBIdKyZs3Q5Ezgn7BK3beEge1QZ49PGbRGtnLoOmOwR17pdpf1XRJg7wbEt LjeQGdpsixEnK4N5pTFTPbLEh5tD+rnLbF/BA6DLuYjfpkwlkYzGj82tr+pmlqigQeWd a9uJkjBOunvq8DrqZufZSKswX0lHFzBXF0QNFKGfj7jhQ1Vwy4ZbP1BBuTGEMroLK540 RbRqAwuJTgstYzC85AtYN204Jenza+UJ3K5EZdg61SPD44ATk43pJrCeUAwvrx8NZbrq 4yimv7LHyKXrSCC6fwRx2ip1f4xhdW4dlBKxo88nR0v7yDtKBQT4wYd6VJbnWanAWe+B h/4w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=IPQ1SSMb; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id bn8-20020a056000060800b002bddc018216si210025wrb.1.2023.02.04.02.29.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 02:29:40 -0800 (PST) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D5F632403A5 for ; Sat, 4 Feb 2023 11:29:39 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P880M3DXqz6tpW for ; Sat, 4 Feb 2023 11:29:39 +0100 (CET) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=IPQ1SSMb; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:32143 Archived-At: You can also write: --- author: first: John last: Doe --- And use in your template use $author.first$ Le Friday 03 February 2023 =C3=A0 12:57:16PM, Paul Kelleher a =C3=A9crit : > Just realized that one approach is to have Pandoc pass the full name stri= ng > (e.g. 'First Last') to the template, but then to create a macro inside th= e > template that will return just the first word in the string, as described= [1] > here. That worked for me! >=20 > On Fri, Feb 3, 2023 at 11:55 AM Paul Kelleher <[2]paul-JZTKsBFbLNkkm2bSNb+QWw@public.gmane.org> = wrote: >=20 > Hello, >=20 > Is it possible to use a pipe in a template to generate just the first= word > of a variable?=C2=A0 >=20 > My specific use case is to produce just the first name of a first-and= -last > name that I place in the "to" field of a YAML block that passes info = to a > letter template. I'd like to generate "Dear ,". To do thi= s now, > I've defined "to" as an array, with the first name as the first value= of > the array and the last name as the second value; then I can use the > predefined 'first' pipe to return just the first name. But for reason= s > specific to my particular use case, it'd be great to have a pipe that > returns the first word of a multi-word variable. >=20 > Thanks! >=20 > -- > You received this message because you are subscribed to a topic in th= e > Google Groups "pandoc-discuss" group. > To unsubscribe from this topic, visit [3]https://groups.google.com/d/= topic/ > pandoc-discuss/cEe1t7Fw4-o/unsubscribe. > To unsubscribe from this group and all its topics, send an email to [= 4] > pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [5]https://groups.google.com= /d/ > msgid/pandoc-discuss/ > 074330dd-ae01-4471-9550-ea09b2fe7363n%40googlegroups.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= email > to [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [7]https://groups.google.com/d/m= sgid/ > pandoc-discuss/ > CAD0VMekeTBm__Qt6bAqFMCQ8TVXF%2Bs9Uf4_xsZHxmJ3b_CNVuw%40mail.gmail.com. >=20 > References: >=20 > [1] https://tex.stackexchange.com/questions/316730/extract-first-word-in-= a-string > [2] mailto:paul-JZTKsBFbLNkkm2bSNb+QWw@public.gmane.org > [3] https://groups.google.com/d/topic/pandoc-discuss/cEe1t7Fw4-o/unsubscr= ibe > [4] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [5] https://groups.google.com/d/msgid/pandoc-discuss/074330dd-ae01-4471-9= 550-ea09b2fe7363n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [7] https://groups.google.com/d/msgid/pandoc-discuss/CAD0VMekeTBm__Qt6bAq= FMCQ8TVXF%2Bs9Uf4_xsZHxmJ3b_CNVuw%40mail.gmail.com?utm_medium=3Demail&utm_s= ource=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 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/Y94zkCXSuBYj2ePA%40localhost.