On Sat, Jan 3, 2015 at 2:17 AM, Caleb McDaniel <calebmcd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Thanks, this looks great! And seems like it would be helpful for a filter I use to turn endnotes into inline notes in Markdown. "Brittle" is a good word for my current implementation of the query.

https://gist.github.com/wcaleb/17ca606788f9b4b9a36b

If I understand you correctly, the current Matcher only works for Blocks, not Inlines? (Currently writing on low sleep, so that may not even be a sensible question.)

Well, the API was a bit sparse on Inlines. I've gone ahead and added queries the rest of the Inline elements, so API support is now up to 90% or so. All the Inlines are there, but there are a couple instances of attributes I can't query yet.

And could it match, say, any block that has any block other than a paragraph nested inside it? (Ditto to previous parenthetical.)

So right now, there's no negation, and no quantification other than "there exists". I added support for a search operator, so you can say:

Query().Para().search(node)

and it will go find all paragraphs at node or below. But it can't prove e.g. that there aren't any non-Paragraph nodes. I could imagine adding a "forall" operator that would allow something like that. Maybe something like:

Query().Note().forall(Query().Para())

But I have to spend some more time thinking about the semantics of that.

Caleb McDaniel

--
You received this message because you are subscribed to a topic in the Google Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/NsEGkTN4fnk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/4b9fb48b-091c-44c6-9201-f5c5b559253f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJ9X%3DkZu94RTat%2BSKLknvUJJQWnENd9xkF9DJCJCHhiBY-qyDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.