From: Paul Kelleher <paul-JZTKsBFbLNkkm2bSNb+QWw@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Use a pipe to generate only first word of a variable?
Date: Fri, 3 Feb 2023 09:55:50 -0800 (PST) [thread overview]
Message-ID: <074330dd-ae01-4471-9550-ea09b2fe7363n@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1084 bytes --]
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 <first name>,". 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.
[-- Attachment #1.2: Type: text/html, Size: 1446 bytes --]
next reply other threads:[~2023-02-03 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 17:55 Paul Kelleher [this message]
[not found] ` <074330dd-ae01-4471-9550-ea09b2fe7363n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-02-03 18:57 ` Paul Kelleher
[not found] ` <CAD0VMekeTBm__Qt6bAqFMCQ8TVXF+s9Uf4_xsZHxmJ3b_CNVuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-02-04 10:29 ` Bastien DUMONT
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=074330dd-ae01-4471-9550-ea09b2fe7363n@googlegroups.com \
--to=paul-jztksbfblnkkm2bsnb+qww@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).