From: ThomasH <therch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Report Location in Lua Filter
Date: Thu, 27 Apr 2023 02:22:09 -0700 (PDT) [thread overview]
Message-ID: <f2713b34-0040-4c07-8d8b-dd3bd0de1755n@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1602 bytes --]
Hi all,
first off, thanks for Pandoc, it's a beautiful tool. I've been using it on
and off over many years, mostly for ad-hoc tasks, and am now in the middle
of a larger transformation project.
I have several use cases where I want to report a location in a file rather
than transform it, e.g. ordered lists with a single list item which doesn't
make a lot of sense. It's easy enough to spot such constructs in a Lua
filter, but for the files I'm working on it is not so obvious how to
transform such constructs. So we made a decision to fix these situations by
hand.
In an input file base of roughly 3,500 files it would just be helpful to
generate a report that produces all the locations where such constructs
appear. So I'm looking for ways to deploy Pandoc's AST as a vehicle to
report these occasions. Ideally, I would e.g. attatch "LogMessage" objects
to the AST at these places, and on output these log messages would be
filled, eg. with file path and line number of the current output file.
Would something in this vein be possible?
I'm sorry if the answer is too obvious, it's just now that I really take a
look at all the documentation and examples.
Thanks, T.
--
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/f2713b34-0040-4c07-8d8b-dd3bd0de1755n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 2026 bytes --]
reply other threads:[~2023-04-27 9:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=f2713b34-0040-4c07-8d8b-dd3bd0de1755n@googlegroups.com \
--to=therch-re5jqeeqqe8avxtiumwx3w@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).