From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32141 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Kelleher Newsgroups: gmane.text.pandoc Subject: Use a pipe to generate only first word of a variable? Date: Fri, 3 Feb 2023 09:55:50 -0800 (PST) Message-ID: <074330dd-ae01-4471-9550-ea09b2fe7363n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3290_178913118.1675446950675" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23133"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDYKNHHAVIJBBJ4V6WPAMGQEGNBYNGA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 03 18:55:55 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f59.google.com ([209.85.210.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pO0Hz-0005mi-5E for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 03 Feb 2023 18:55:55 +0100 Original-Received: by mail-ot1-f59.google.com with SMTP id f72-20020a9d03ce000000b0068be2064b3esf2694080otf.6 for ; Fri, 03 Feb 2023 09:55:55 -0800 (PST) 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-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=OX1cybIiXydaQtkudXmjdVz372fJTWzBtuMMbX2MdY0=; b=ahU0BGwP/m62UnY6R4FH9DZwIzlKIMHjDU3rfih6sM2Eqx6l4kZ7nZlRK+f6PtJh6s G31kJwqt4I/2kZVWd15nC5BX5zW19hGwJlyt+RpSnw1TPGUED7lXB7CinRZIp9GKDl0k fwbzVtPGJyvSsxGMHqqOJfokfDlV58FW7w31QkcRcP/Uf9sWtsrYGQAvzmZHq22JUoOC 0E8v358xgqMG44jaNAuH4irJI7hHBl7LT0UbAfyHeHqmM+1fRIJpK4mRdhutFTaKkn4R FENdP34STe9+X5SDUFczv2zGxbFREUCCSVmhHC3deD0yfGXhYh3uRZRgbycPScJzkC/U HqYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulkelleher-net.20210112.gappssmtp.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=OX1cybIiXydaQtkudXmjdVz372fJTWzBtuMMbX2MdY0=; b=qtVUcST40Pq3vi3I8+Eu5WyRp60F1y5qUSxCCRSHtm8F468kjyiS9fenMBguEszJSR SWgQlAzQwWUCFNDtFR3opNZLgMtarWQZ1b0gtiAMMxbIirkNnPDS3vmPCb/DsJZAmRFy JWV9+kl2cFl6UodTc9HfZ9/RGe2qCZ7Bx7Wdk5UZyuaNIZPbBQjPQhMEQE0YFgSVoqUa +h3+OeuII3Ze3PQN5LiGPp3dcRdGMpWwXUOCyyLWVWiooA4pdiYqG4CnGprkCUjxzfud onuXrcq8Zb1qjdD8foUrFKV4wAWE/u7LLggAOaaW/DCkn6YtZXjOm3js50g9peLowYew 380A== 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-sender:mime-version:subject:message-id:to:from:date :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=OX1cybIiXydaQtkudXmjdVz372fJTWzBtuMMbX2MdY0=; b=U2pLVPbdFpscDN1RSXDw4dpajfacwBeym2d13VoysME3rHQ/uzG5JRhxu9M/dJnpjA AeN82S9vnwzYUUtYwDDehQu3+0+hWIZVmkNxxknlQYcyv7oeUvQE+erQ8swR2PMIKq/6 iZArlSKhy+XyajGdNZ1hWCK0D/s7VAJMPD5h2TWprI4+pAmHFw3mzXJ9i1i9WDlh3oVK GanL6Y/J2y9p2dxStg1UiPC0MRkDlINiwj8cLPDVxZepVAWM+85eaeGgTukFXorrUVO8 SjF54Z3naNn6K0OhrOEOoQRqlApCciW9+iqEw+StOhQf5peKogGHX4YkpWgAL/0Sl0BJ phEw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKXtqIQWLPylQ1RGFAvqo812kSecue6mlX/edGVw9SORFXqWxUvF 1RDpw9u0D6DNnbg7Ax1BA7A= X-Google-Smtp-Source: AK7set+OH1UE3F1Hx34/1HGIjaVyP4G339Zz2ijyt+f4nNQ/3LD9aFnB7PkFo8hjPzkllyQQCqfUzw== X-Received: by 2002:a05:6870:1098:b0:169:fe19:7aa7 with SMTP id 24-20020a056870109800b00169fe197aa7mr327144oaq.68.1675446954007; Fri, 03 Feb 2023 09:55:54 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:6143:0:b0:378:5e56:83f3 with SMTP id v64-20020aca6143000000b003785e5683f3ls406599oib.4.-pod-prod-gmail; Fri, 03 Feb 2023 09:55:51 -0800 (PST) X-Received: by 2002:aca:f19:0:b0:36e:928b:5be5 with SMTP id 25-20020aca0f19000000b0036e928b5be5mr534944oip.189.1675446951313; Fri, 03 Feb 2023 09:55:51 -0800 (PST) X-Original-Sender: paul-JZTKsBFbLNkkm2bSNb+QWw@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:32141 Archived-At: ------=_Part_3290_178913118.1675446950675 Content-Type: multipart/alternative; boundary="----=_Part_3291_1760349222.1675446950675" ------=_Part_3291_1760349222.1675446950675 Content-Type: text/plain; charset="UTF-8" Hello, Is it possible to use a pipe in a template to generate just the first word of a variable? 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 this 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 reasons specific to my particular use case, it'd be great to have a pipe that returns the first word of a multi-word variable. Thanks! -- 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/074330dd-ae01-4471-9550-ea09b2fe7363n%40googlegroups.com. ------=_Part_3291_1760349222.1675446950675 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello,

Is it possible to use a pipe in a template to g= enerate just the first word of a variable?=C2=A0

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 <first name>,". To do thi= s now, I've defined "to" as an array, with the first name as the first valu= e of the array and the last name as the second value; then I can use the pr= edefined 'first' pipe to return just the first name. But for reasons specif= ic to my particular use case, it'd be great to have a pipe that returns the= first word of a multi-word variable.

Thanks!

--
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/074330dd-ae01-4471-9550-ea09b2fe7363n%40googlegroups.= com.
------=_Part_3291_1760349222.1675446950675-- ------=_Part_3290_178913118.1675446950675--