From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Iterate over YAML tree and extract elements when converting to another format (e.g. DOCX or PDF)
Date: Thu, 15 Feb 2018 10:01:03 -0800 [thread overview]
Message-ID: <20180215180102.GC42908@Johns-MacBook-Pro.local> (raw)
In-Reply-To: <a3611b42-8260-42ab-95e7-b6baba1c747b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
If you're targeting PDF, yes, this is easy, you can just
create a custom latex template and use the iteration commands
($for$) provided in the template language.
For Docx, you'd need to write a filter, because there is
no template.
+++ Brendan Pearl [Feb 15 18 02:33 ]:
> Is it possible to iterate over a YAML file containing the elements I
> want converted into another format?
> Here is a snippet of my current YAML structure (it is in YAML so that I
> can use it in other ways later - such as with R)
> ---
> Items:
> "@Kamieniecki_Prevalencepsychologicaldistress_2001":
> Focus: "Prevalence of psychological distress or disorders in young
> people who are homeless in Australia"
> Number of studies: 14
> Reported findings: "Young people who are homeless have high rates
> of psychological disorders and score higher on tests of psychological
> distress"
> Reference: "@Kamieniecki_Prevalencepsychologicaldistress_2001"
> Tags:
> - negative_outcomes
> - mental_health
> "@EmbletonMwangiEtAl_epidemiologysubstanceuse_2013":
> Focus: "Prevalence of lifetime substance use in children living on
> the street in 'resource constrained settings'"
> Number of studies: 50
> Reported findings: "Pooled prevalence estimate of 60% [95% CI:
> 51-69%]"
> Reference: "@EmbletonMwangiEtAl_epidemiologysubstanceuse_2013"
> Tags:
> - negative_outcomes
> - substance_use
> ...
> Is it possible to get pandoc (or a pandoc filter) to iterate over each
> of the items and extract specific elements (perhaps even conditionally
> - e.g. only those with certain tags)?
> Brendan.
>
> --
> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to
> [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> [3]https://groups.google.com/d/msgid/pandoc-discuss/a3611b42-8260-42ab-
> 95e7-b6baba1c747b%40googlegroups.com.
> For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
> 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> 2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> 3. https://groups.google.com/d/msgid/pandoc-discuss/a3611b42-8260-42ab-95e7-b6baba1c747b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
> 4. https://groups.google.com/d/optout
prev parent reply other threads:[~2018-02-15 18:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 10:33 Brendan Pearl
[not found] ` <a3611b42-8260-42ab-95e7-b6baba1c747b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-02-15 18:01 ` John MacFarlane [this message]
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=20180215180102.GC42908@Johns-MacBook-Pro.local \
--to=jgm-tvlzxgkolnx2fbvcvol8/a@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).