* panflute: a pythonic alternative to pandocfilters
@ 2016-04-26 5:12 Sergio Correia
[not found] ` <CAKGY2Pk8FYax5vwyh=Spzyi8gB9d95GkjV+5tNKLpenpC1Fgfw@mail.gmail.com>
[not found] ` <b6a8c6cf-cae7-403a-99e9-4e170a150428-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 2 replies; 19+ messages in thread
From: Sergio Correia @ 2016-04-26 5:12 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1549 bytes --]
Dear all,
After being a heavy user of pandocfilters.py for a few years, I wrote an
alternative package (with a very similar API) that takes a more pythonic
approach:
- Elements are proper objects (with properties and methods) instead of
dicts and lists
- Elements can be created using named arguments: Header(Str('The'),
Space, Str('Title'), level=1)
- Batteries are included: I included functions that I ended up reusing
through my different filters\
The source and documentation is
here: https://github.com/sergiocorreia/panflute . It currently uses Python
3 but if there is demand from Python 2 users we could try a port.
Ports of some of the existing filters are
here: https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
More examples will be placed
here: https://github.com/sergiocorreia/panflute-filters
Feel free to comment here or on github; any suggestions or pull requests
are more than welcome :)
Best,
Sergio
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 2268 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CAKGY2Pk8FYax5vwyh=Spzyi8gB9d95GkjV+5tNKLpenpC1Fgfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-04-26 9:36 ` Wagner Macedo
[not found] ` <CAKGY2Pk1j4MJnxKHpT4YZZkooJ-Kd05it9iGHFY1eNw7dPyjog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Wagner Macedo @ 2016-04-26 9:36 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 2458 bytes --]
Excellent, congratulations for the effort.
What subversion of Python 3 is targeted?
Em 26/04/2016 02:12, "Sergio Correia" <sergio.correia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
Dear all,
After being a heavy user of pandocfilters.py for a few years, I wrote an
alternative package (with a very similar API) that takes a more pythonic
approach:
- Elements are proper objects (with properties and methods) instead of
dicts and lists
- Elements can be created using named arguments: Header(Str('The'),
Space, Str('Title'), level=1)
- Batteries are included: I included functions that I ended up reusing
through my different filters\
The source and documentation is here:
https://github.com/sergiocorreia/panflute . It currently uses Python 3 but
if there is demand from Python 2 users we could try a port.
Ports of some of the existing filters are here:
https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
More examples will be placed here:
https://github.com/sergiocorreia/panflute-filters
Feel free to comment here or on github; any suggestions or pull requests
are more than welcome :)
Best,
Sergio
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
<https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAKGY2Pk1j4MJnxKHpT4YZZkooJ-Kd05it9iGHFY1eNw7dPyjog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 4070 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CAKGY2Pk1j4MJnxKHpT4YZZkooJ-Kd05it9iGHFY1eNw7dPyjog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-04-26 15:00 ` Sergio Correia
[not found] ` <5ee6e6e1-8e2e-450d-b793-c0464e4be449-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Sergio Correia @ 2016-04-26 15:00 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2862 bytes --]
Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems I'm not
using features specific to any of these sub versions. That said, for big
documents it might be faster to have 3.5+ because OrderedDict was rewritten
in C.
On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>
> Excellent, congratulations for the effort.
>
> What subversion of Python 3 is targeted?
> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>>
> escreveu:
>
> Dear all,
>
> After being a heavy user of pandocfilters.py for a few years, I wrote an
> alternative package (with a very similar API) that takes a more pythonic
> approach:
>
>
> - Elements are proper objects (with properties and methods) instead of
> dicts and lists
> - Elements can be created using named arguments: Header(Str('The'),
> Space, Str('Title'), level=1)
> - Batteries are included: I included functions that I ended up reusing
> through my different filters\
>
> The source and documentation is here:
> https://github.com/sergiocorreia/panflute . It currently uses Python 3
> but if there is demand from Python 2 users we could try a port.
>
> Ports of some of the existing filters are here:
> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>
> More examples will be placed here:
> https://github.com/sergiocorreia/panflute-filters
>
> Feel free to comment here or on github; any suggestions or pull requests
> are more than welcome :)
>
> Best,
> Sergio
>
> --
> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 6756 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <5ee6e6e1-8e2e-450d-b793-c0464e4be449-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-04-26 15:20 ` Wagner Macedo
[not found] ` <CAKGY2PmThM-67XiA9Yqy+KfY4MPJu9QN1dGpid3qS4zvz4=a+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Wagner Macedo @ 2016-04-26 15:20 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 3945 bytes --]
Agree. I checked some of the documentation and I'm impressed, it's a very
good job.
I'll try in the following days to convert some of my current scripts to
panflute and I'll let you know.
--
Wagner Macedo
On 26 April 2016 at 12:00, Sergio Correia <sergio.correia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems I'm
> not using features specific to any of these sub versions. That said, for
> big documents it might be faster to have 3.5+ because OrderedDict was
> rewritten in C.
>
> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>
>> Excellent, congratulations for the effort.
>>
>> What subversion of Python 3 is targeted?
>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
>>
>> Dear all,
>>
>> After being a heavy user of pandocfilters.py for a few years, I wrote an
>> alternative package (with a very similar API) that takes a more pythonic
>> approach:
>>
>>
>> - Elements are proper objects (with properties and methods) instead
>> of dicts and lists
>> - Elements can be created using named arguments: Header(Str('The'),
>> Space, Str('Title'), level=1)
>> - Batteries are included: I included functions that I ended up
>> reusing through my different filters\
>>
>> The source and documentation is here:
>> https://github.com/sergiocorreia/panflute . It currently uses Python 3
>> but if there is demand from Python 2 users we could try a port.
>>
>> Ports of some of the existing filters are here:
>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>
>> More examples will be placed here:
>> https://github.com/sergiocorreia/panflute-filters
>>
>> Feel free to comment here or on github; any suggestions or pull requests
>> are more than welcome :)
>>
>> Best,
>> Sergio
>>
>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAKGY2PmThM-67XiA9Yqy%2BKfY4MPJu9QN1dGpid3qS4zvz4%3Da%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 6346 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CAKGY2PmThM-67XiA9Yqy+KfY4MPJu9QN1dGpid3qS4zvz4=a+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-04-27 8:23 ` Samuel Coavoux
[not found] ` <bbc35e99-d664-45d4-b80a-a0847c298331-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Samuel Coavoux @ 2016-04-27 8:23 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 4941 bytes --]
This looks very promising, thank you for the package.
One thing that is missing from pandocfilters is the ability to easily
manipulate sequences of elements rather than single ones. Something like
(pseudo code):
if type(elem) == "Quoted" and type(next.elem) == "Cite":
there was a library aiming at this functionality, pandocpatterns[^1], but
it hasn't been updated in a while, and I personally never could make it
work.
Do you think that it would be possible to implement this in panflutes?
[^1]: https://bitbucket.org/elliottslaughter/pandocpatterns ; discussed on
the list here :
https://groups.google.com/forum/#!searchin/pandoc-discuss/pandocpatterns/pandoc-discuss/NsEGkTN4fnk/Y520jtQ5EzkJ
Le mardi 26 avril 2016 17:20:47 UTC+2, Wagner Macedo a écrit :
>
> Agree. I checked some of the documentation and I'm impressed, it's a very
> good job.
>
> I'll try in the following days to convert some of my current scripts to
> panflute and I'll let you know.
>
> --
> Wagner Macedo
>
> On 26 April 2016 at 12:00, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> <javascript:>> wrote:
>
>> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems I'm
>> not using features specific to any of these sub versions. That said, for
>> big documents it might be faster to have 3.5+ because OrderedDict was
>> rewritten in C.
>>
>> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>>
>>> Excellent, congratulations for the effort.
>>>
>>> What subversion of Python 3 is targeted?
>>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
>>>
>>> Dear all,
>>>
>>> After being a heavy user of pandocfilters.py for a few years, I wrote an
>>> alternative package (with a very similar API) that takes a more pythonic
>>> approach:
>>>
>>>
>>> - Elements are proper objects (with properties and methods) instead
>>> of dicts and lists
>>> - Elements can be created using named arguments: Header(Str('The'),
>>> Space, Str('Title'), level=1)
>>> - Batteries are included: I included functions that I ended up
>>> reusing through my different filters\
>>>
>>> The source and documentation is here:
>>> https://github.com/sergiocorreia/panflute . It currently uses Python 3
>>> but if there is demand from Python 2 users we could try a port.
>>>
>>> Ports of some of the existing filters are here:
>>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>>
>>> More examples will be placed here:
>>> https://github.com/sergiocorreia/panflute-filters
>>>
>>> Feel free to comment here or on github; any suggestions or pull requests
>>> are more than welcome :)
>>>
>>> Best,
>>> Sergio
>>>
>>> --
>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/bbc35e99-d664-45d4-b80a-a0847c298331%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 9917 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <bbc35e99-d664-45d4-b80a-a0847c298331-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-04-27 8:46 ` Sergio Correia
[not found] ` <6a0a11df-8825-4e0c-8582-948922e9f66b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Sergio Correia @ 2016-04-27 8:46 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 5944 bytes --]
I've thought a bit about adding .parent and .next .previous elements. It
can be done, but with two disclaimers (which I'm not sure if make it worth
it):
1. With some elements, such as tables, parent is not very useful as I
don't know whether a list belonged to a cell in the header or in the table
body (same for definition lists, etc.). A solution would be to add special
TableCell, TableRow, TableHeader, TableData elements, and so on, but this
complicates things. On the other hand, we could then do filters that apply
only to table cells and so on.
2. People might try to modify elem.next or elem.parent, which shouldn't
be done, as it messes up walk() function. This is a similar problem to
modifying a list that is being iterated.
Do you thing it would be useful, given these issues?
On Wednesday, April 27, 2016 at 4:23:43 AM UTC-4, Samuel Coavoux wrote:
>
> This looks very promising, thank you for the package.
>
> One thing that is missing from pandocfilters is the ability to easily
> manipulate sequences of elements rather than single ones. Something like
> (pseudo code):
>
> if type(elem) == "Quoted" and type(next.elem) == "Cite":
>
> there was a library aiming at this functionality, pandocpatterns[^1], but
> it hasn't been updated in a while, and I personally never could make it
> work.
>
> Do you think that it would be possible to implement this in panflutes?
>
> [^1]: https://bitbucket.org/elliottslaughter/pandocpatterns ; discussed
> on the list here :
> https://groups.google.com/forum/#!searchin/pandoc-discuss/pandocpatterns/pandoc-discuss/NsEGkTN4fnk/Y520jtQ5EzkJ
>
> Le mardi 26 avril 2016 17:20:47 UTC+2, Wagner Macedo a écrit :
>>
>> Agree. I checked some of the documentation and I'm impressed, it's a very
>> good job.
>>
>> I'll try in the following days to convert some of my current scripts to
>> panflute and I'll let you know.
>>
>> --
>> Wagner Macedo
>>
>> On 26 April 2016 at 12:00, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems I'm
>>> not using features specific to any of these sub versions. That said, for
>>> big documents it might be faster to have 3.5+ because OrderedDict was
>>> rewritten in C.
>>>
>>> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>>>
>>>> Excellent, congratulations for the effort.
>>>>
>>>> What subversion of Python 3 is targeted?
>>>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
>>>>
>>>> Dear all,
>>>>
>>>> After being a heavy user of pandocfilters.py for a few years, I wrote
>>>> an alternative package (with a very similar API) that takes a more pythonic
>>>> approach:
>>>>
>>>>
>>>> - Elements are proper objects (with properties and methods) instead
>>>> of dicts and lists
>>>> - Elements can be created using named arguments: Header(Str('The'),
>>>> Space, Str('Title'), level=1)
>>>> - Batteries are included: I included functions that I ended up
>>>> reusing through my different filters\
>>>>
>>>> The source and documentation is here:
>>>> https://github.com/sergiocorreia/panflute . It currently uses Python 3
>>>> but if there is demand from Python 2 users we could try a port.
>>>>
>>>> Ports of some of the existing filters are here:
>>>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>>>
>>>> More examples will be placed here:
>>>> https://github.com/sergiocorreia/panflute-filters
>>>>
>>>> Feel free to comment here or on github; any suggestions or pull
>>>> requests are more than welcome :)
>>>>
>>>> Best,
>>>> Sergio
>>>>
>>>> --
>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 11541 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <6a0a11df-8825-4e0c-8582-948922e9f66b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-04-27 9:47 ` Samuel Coavoux
[not found] ` <CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx+nUwmzksFnQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Samuel Coavoux @ 2016-04-27 9:47 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 7997 bytes --]
I don't know about the first disclaimer. I feel like there is a way around
the second, at least for .next elements: we could raise a flag anytime a
.next element is modified and apply a function later on, when its turn
comes. For instance, in pseudo-code, if I wanted to include Cite inside a
previous Quoted element and if there were a .next method, I could do:
next_element_reused = False
if type(elem) == "Quoted" and type(elem.next) == "Cite":
elem.content.append(elem.next)
next_element_reused = True
return(elem)
elif next_element_reused: # to remove the next element
next_element_reused = False
return()
But that would be easier to write as something like:
if type(elem) == "Quoted" and type(elem.next) == "Cite":
elem.content.append(elem.next)
elem.apply_to_next = "skip" # or apply a custom function
return(elem)
I hope this makes sense...
On Wed, Apr 27, 2016 at 10:46 AM, Sergio Correia <sergio.correia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> I've thought a bit about adding .parent and .next .previous elements. It
> can be done, but with two disclaimers (which I'm not sure if make it worth
> it):
>
>
> 1. With some elements, such as tables, parent is not very useful as I
> don't know whether a list belonged to a cell in the header or in the table
> body (same for definition lists, etc.). A solution would be to add special
> TableCell, TableRow, TableHeader, TableData elements, and so on, but this
> complicates things. On the other hand, we could then do filters that apply
> only to table cells and so on.
> 2. People might try to modify elem.next or elem.parent, which
> shouldn't be done, as it messes up walk() function. This is a similar
> problem to modifying a list that is being iterated.
>
> Do you thing it would be useful, given these issues?
>
> On Wednesday, April 27, 2016 at 4:23:43 AM UTC-4, Samuel Coavoux wrote:
>>
>> This looks very promising, thank you for the package.
>>
>> One thing that is missing from pandocfilters is the ability to easily
>> manipulate sequences of elements rather than single ones. Something like
>> (pseudo code):
>>
>> if type(elem) == "Quoted" and type(next.elem) == "Cite":
>>
>> there was a library aiming at this functionality, pandocpatterns[^1], but
>> it hasn't been updated in a while, and I personally never could make it
>> work.
>>
>> Do you think that it would be possible to implement this in panflutes?
>>
>> [^1]: https://bitbucket.org/elliottslaughter/pandocpatterns ; discussed
>> on the list here :
>> https://groups.google.com/forum/#!searchin/pandoc-discuss/pandocpatterns/pandoc-discuss/NsEGkTN4fnk/Y520jtQ5EzkJ
>>
>> Le mardi 26 avril 2016 17:20:47 UTC+2, Wagner Macedo a écrit :
>>>
>>> Agree. I checked some of the documentation and I'm impressed, it's a
>>> very good job.
>>>
>>> I'll try in the following days to convert some of my current scripts to
>>> panflute and I'll let you know.
>>>
>>> --
>>> Wagner Macedo
>>>
>>> On 26 April 2016 at 12:00, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>
>>>> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems I'm
>>>> not using features specific to any of these sub versions. That said, for
>>>> big documents it might be faster to have 3.5+ because OrderedDict was
>>>> rewritten in C.
>>>>
>>>> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>>>>
>>>>> Excellent, congratulations for the effort.
>>>>>
>>>>> What subversion of Python 3 is targeted?
>>>>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
>>>>>
>>>>> Dear all,
>>>>>
>>>>> After being a heavy user of pandocfilters.py for a few years, I wrote
>>>>> an alternative package (with a very similar API) that takes a more pythonic
>>>>> approach:
>>>>>
>>>>>
>>>>> - Elements are proper objects (with properties and methods)
>>>>> instead of dicts and lists
>>>>> - Elements can be created using named arguments:
>>>>> Header(Str('The'), Space, Str('Title'), level=1)
>>>>> - Batteries are included: I included functions that I ended up
>>>>> reusing through my different filters\
>>>>>
>>>>> The source and documentation is here:
>>>>> https://github.com/sergiocorreia/panflute . It currently uses Python
>>>>> 3 but if there is demand from Python 2 users we could try a port.
>>>>>
>>>>> Ports of some of the existing filters are here:
>>>>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>>>>
>>>>> More examples will be placed here:
>>>>> https://github.com/sergiocorreia/panflute-filters
>>>>>
>>>>> Feel free to comment here or on github; any suggestions or pull
>>>>> requests are more than welcome :)
>>>>>
>>>>> Best,
>>>>> Sergio
>>>>>
>>>>> --
>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>> --
>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
> 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/MitGRIUwEGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx%2BnUwmzksFnQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 11482 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx+nUwmzksFnQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-04-27 11:43 ` Sergio Correia
2016-04-27 11:49 ` Wagner Macedo
1 sibling, 0 replies; 19+ messages in thread
From: Sergio Correia @ 2016-04-27 11:43 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 8694 bytes --]
I'll release a version that passes pep8 and other style checks, and they
work on an experimental approach to sequences.
Ideally I would also want walk() to accept selectors (like css selectors:
http://www.w3schools.com/cssref/css_selectors.asp ).
Doing this change would simplify many filters, by removing the if
conditions present in every filter function.
On Wednesday, April 27, 2016 at 5:47:52 AM UTC-4, Samuel Coavoux wrote:
>
> I don't know about the first disclaimer. I feel like there is a way around
> the second, at least for .next elements: we could raise a flag anytime a
> .next element is modified and apply a function later on, when its turn
> comes. For instance, in pseudo-code, if I wanted to include Cite inside a
> previous Quoted element and if there were a .next method, I could do:
>
> next_element_reused = False
>
> if type(elem) == "Quoted" and type(elem.next) == "Cite":
> elem.content.append(elem.next)
> next_element_reused = True
> return(elem)
> elif next_element_reused: # to remove the next element
> next_element_reused = False
> return()
>
> But that would be easier to write as something like:
>
> if type(elem) == "Quoted" and type(elem.next) == "Cite":
> elem.content.append(elem.next)
> elem.apply_to_next = "skip" # or apply a custom function
> return(elem)
>
> I hope this makes sense...
>
>
>
>
> On Wed, Apr 27, 2016 at 10:46 AM, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> <javascript:>> wrote:
>
>> I've thought a bit about adding .parent and .next .previous elements. It
>> can be done, but with two disclaimers (which I'm not sure if make it worth
>> it):
>>
>>
>> 1. With some elements, such as tables, parent is not very useful as I
>> don't know whether a list belonged to a cell in the header or in the table
>> body (same for definition lists, etc.). A solution would be to add special
>> TableCell, TableRow, TableHeader, TableData elements, and so on, but this
>> complicates things. On the other hand, we could then do filters that apply
>> only to table cells and so on.
>> 2. People might try to modify elem.next or elem.parent, which
>> shouldn't be done, as it messes up walk() function. This is a similar
>> problem to modifying a list that is being iterated.
>>
>> Do you thing it would be useful, given these issues?
>>
>> On Wednesday, April 27, 2016 at 4:23:43 AM UTC-4, Samuel Coavoux wrote:
>>>
>>> This looks very promising, thank you for the package.
>>>
>>> One thing that is missing from pandocfilters is the ability to easily
>>> manipulate sequences of elements rather than single ones. Something like
>>> (pseudo code):
>>>
>>> if type(elem) == "Quoted" and type(next.elem) == "Cite":
>>>
>>> there was a library aiming at this functionality, pandocpatterns[^1],
>>> but it hasn't been updated in a while, and I personally never could make it
>>> work.
>>>
>>> Do you think that it would be possible to implement this in panflutes?
>>>
>>> [^1]: https://bitbucket.org/elliottslaughter/pandocpatterns ; discussed
>>> on the list here :
>>> https://groups.google.com/forum/#!searchin/pandoc-discuss/pandocpatterns/pandoc-discuss/NsEGkTN4fnk/Y520jtQ5EzkJ
>>>
>>> Le mardi 26 avril 2016 17:20:47 UTC+2, Wagner Macedo a écrit :
>>>>
>>>> Agree. I checked some of the documentation and I'm impressed, it's a
>>>> very good job.
>>>>
>>>> I'll try in the following days to convert some of my current scripts to
>>>> panflute and I'll let you know.
>>>>
>>>> --
>>>> Wagner Macedo
>>>>
>>>> On 26 April 2016 at 12:00, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems
>>>>> I'm not using features specific to any of these sub versions. That said,
>>>>> for big documents it might be faster to have 3.5+ because OrderedDict was
>>>>> rewritten in C.
>>>>>
>>>>> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>>>>>
>>>>>> Excellent, congratulations for the effort.
>>>>>>
>>>>>> What subversion of Python 3 is targeted?
>>>>>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>> escreveu:
>>>>>>
>>>>>> Dear all,
>>>>>>
>>>>>> After being a heavy user of pandocfilters.py for a few years, I wrote
>>>>>> an alternative package (with a very similar API) that takes a more pythonic
>>>>>> approach:
>>>>>>
>>>>>>
>>>>>> - Elements are proper objects (with properties and methods)
>>>>>> instead of dicts and lists
>>>>>> - Elements can be created using named arguments:
>>>>>> Header(Str('The'), Space, Str('Title'), level=1)
>>>>>> - Batteries are included: I included functions that I ended up
>>>>>> reusing through my different filters\
>>>>>>
>>>>>> The source and documentation is here:
>>>>>> https://github.com/sergiocorreia/panflute . It currently uses Python
>>>>>> 3 but if there is demand from Python 2 users we could try a port.
>>>>>>
>>>>>> Ports of some of the existing filters are here:
>>>>>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>>>>>
>>>>>> More examples will be placed here:
>>>>>> https://github.com/sergiocorreia/panflute-filters
>>>>>>
>>>>>> Feel free to comment here or on github; any suggestions or pull
>>>>>> requests are more than welcome :)
>>>>>>
>>>>>> Best,
>>>>>> Sergio
>>>>>>
>>>>>> --
>>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>> --
>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>> 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/MitGRIUwEGo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c1f6974f-c91e-4ae5-ad52-a3b04c5b9a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 16363 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx+nUwmzksFnQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-27 11:43 ` Sergio Correia
@ 2016-04-27 11:49 ` Wagner Macedo
1 sibling, 0 replies; 19+ messages in thread
From: Wagner Macedo @ 2016-04-27 11:49 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 9126 bytes --]
A finite state machine, isn't it? It would be useful.
Em 27/04/2016 06:47, "Samuel Coavoux" <samuel.coavoux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu:
> I don't know about the first disclaimer. I feel like there is a way around
> the second, at least for .next elements: we could raise a flag anytime a
> .next element is modified and apply a function later on, when its turn
> comes. For instance, in pseudo-code, if I wanted to include Cite inside a
> previous Quoted element and if there were a .next method, I could do:
>
> next_element_reused = False
>
> if type(elem) == "Quoted" and type(elem.next) == "Cite":
> elem.content.append(elem.next)
> next_element_reused = True
> return(elem)
> elif next_element_reused: # to remove the next element
> next_element_reused = False
> return()
>
> But that would be easier to write as something like:
>
> if type(elem) == "Quoted" and type(elem.next) == "Cite":
> elem.content.append(elem.next)
> elem.apply_to_next = "skip" # or apply a custom function
> return(elem)
>
> I hope this makes sense...
>
>
>
>
> On Wed, Apr 27, 2016 at 10:46 AM, Sergio Correia <sergio.correia-Re5JQEeQqe8@public.gmane.orgm
> > wrote:
>
>> I've thought a bit about adding .parent and .next .previous elements. It
>> can be done, but with two disclaimers (which I'm not sure if make it worth
>> it):
>>
>>
>> 1. With some elements, such as tables, parent is not very useful as I
>> don't know whether a list belonged to a cell in the header or in the table
>> body (same for definition lists, etc.). A solution would be to add special
>> TableCell, TableRow, TableHeader, TableData elements, and so on, but this
>> complicates things. On the other hand, we could then do filters that apply
>> only to table cells and so on.
>> 2. People might try to modify elem.next or elem.parent, which
>> shouldn't be done, as it messes up walk() function. This is a similar
>> problem to modifying a list that is being iterated.
>>
>> Do you thing it would be useful, given these issues?
>>
>> On Wednesday, April 27, 2016 at 4:23:43 AM UTC-4, Samuel Coavoux wrote:
>>>
>>> This looks very promising, thank you for the package.
>>>
>>> One thing that is missing from pandocfilters is the ability to easily
>>> manipulate sequences of elements rather than single ones. Something like
>>> (pseudo code):
>>>
>>> if type(elem) == "Quoted" and type(next.elem) == "Cite":
>>>
>>> there was a library aiming at this functionality, pandocpatterns[^1],
>>> but it hasn't been updated in a while, and I personally never could make it
>>> work.
>>>
>>> Do you think that it would be possible to implement this in panflutes?
>>>
>>> [^1]: https://bitbucket.org/elliottslaughter/pandocpatterns ; discussed
>>> on the list here :
>>> https://groups.google.com/forum/#!searchin/pandoc-discuss/pandocpatterns/pandoc-discuss/NsEGkTN4fnk/Y520jtQ5EzkJ
>>>
>>> Le mardi 26 avril 2016 17:20:47 UTC+2, Wagner Macedo a écrit :
>>>>
>>>> Agree. I checked some of the documentation and I'm impressed, it's a
>>>> very good job.
>>>>
>>>> I'll try in the following days to convert some of my current scripts to
>>>> panflute and I'll let you know.
>>>>
>>>> --
>>>> Wagner Macedo
>>>>
>>>> On 26 April 2016 at 12:00, Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>> Did a quick check of the whatsnew for 3.3, 3.4 and 3.5 and it seems
>>>>> I'm not using features specific to any of these sub versions. That said,
>>>>> for big documents it might be faster to have 3.5+ because OrderedDict was
>>>>> rewritten in C.
>>>>>
>>>>> On Tuesday, April 26, 2016 at 5:36:32 AM UTC-4, Wagner Macedo wrote:
>>>>>>
>>>>>> Excellent, congratulations for the effort.
>>>>>>
>>>>>> What subversion of Python 3 is targeted?
>>>>>> Em 26/04/2016 02:12, "Sergio Correia" <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>> escreveu:
>>>>>>
>>>>>> Dear all,
>>>>>>
>>>>>> After being a heavy user of pandocfilters.py for a few years, I wrote
>>>>>> an alternative package (with a very similar API) that takes a more pythonic
>>>>>> approach:
>>>>>>
>>>>>>
>>>>>> - Elements are proper objects (with properties and methods)
>>>>>> instead of dicts and lists
>>>>>> - Elements can be created using named arguments:
>>>>>> Header(Str('The'), Space, Str('Title'), level=1)
>>>>>> - Batteries are included: I included functions that I ended up
>>>>>> reusing through my different filters\
>>>>>>
>>>>>> The source and documentation is here:
>>>>>> https://github.com/sergiocorreia/panflute . It currently uses Python
>>>>>> 3 but if there is demand from Python 2 users we could try a port.
>>>>>>
>>>>>> Ports of some of the existing filters are here:
>>>>>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>>>>>
>>>>>> More examples will be placed here:
>>>>>> https://github.com/sergiocorreia/panflute-filters
>>>>>>
>>>>>> Feel free to comment here or on github; any suggestions or pull
>>>>>> requests are more than welcome :)
>>>>>>
>>>>>> Best,
>>>>>> Sergio
>>>>>>
>>>>>> --
>>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>> --
>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/5ee6e6e1-8e2e-450d-b793-c0464e4be449%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>> 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/MitGRIUwEGo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/6a0a11df-8825-4e0c-8582-948922e9f66b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx%2BnUwmzksFnQg%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx%2BnUwmzksFnQg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAKGY2P%3DBgZ8wujFmJgZ6FLgdfj-K9O9XXkwqOhBNXt9oV06Anw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 12925 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <b6a8c6cf-cae7-403a-99e9-4e170a150428-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-05-07 18:43 ` Sergio Correia
[not found] ` <22e266e0-843e-4a87-af41-df0cf37ab7ea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-01 12:23 ` Stefan Björk
2016-12-14 4:47 ` Kolen Cheung
2 siblings, 1 reply; 19+ messages in thread
From: Sergio Correia @ 2016-05-07 18:43 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2547 bytes --]
Thanks to everyone's suggestions, I have added several useful features to
panflute. At this point, I think the API is stable enough for production
use (i.e. don't expect it to be different one year from now), and much more
powerful and simpler that all the alternatives (at least if you use
Python). Changes include:
- A detailed website build with sphinx:
http://scorreia.com/software/panflute/ . It includes examples, installation
instructions (just run pip!), and the documentation.
- Elements are now aware of their parents and siblings. Thus, you can do
elem.parent , elem.next, etc.
- I added a few elements (TableRow, TableCell) so working with tables
and lists is way easier.
Note that the examples might be useful even by themselves. They include
adding CSV tables, "include" directives for other markdown files, etc.
Cheers,
S
On Tuesday, April 26, 2016 at 1:12:31 AM UTC-4, Sergio Correia wrote:
>
> Dear all,
>
> After being a heavy user of pandocfilters.py for a few years, I wrote an
> alternative package (with a very similar API) that takes a more pythonic
> approach:
>
>
> - Elements are proper objects (with properties and methods) instead of
> dicts and lists
> - Elements can be created using named arguments: Header(Str('The'),
> Space, Str('Title'), level=1)
> - Batteries are included: I included functions that I ended up reusing
> through my different filters\
>
> The source and documentation is here:
> https://github.com/sergiocorreia/panflute . It currently uses Python 3
> but if there is demand from Python 2 users we could try a port.
>
> Ports of some of the existing filters are here:
> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>
> More examples will be placed here:
> https://github.com/sergiocorreia/panflute-filters
>
> Feel free to comment here or on github; any suggestions or pull requests
> are more than welcome :)
>
> Best,
> Sergio
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-af41-df0cf37ab7ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 5207 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <22e266e0-843e-4a87-af41-df0cf37ab7ea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-05-09 17:09 ` John MacFarlane
[not found] ` <20160509170931.GB3958-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: John MacFarlane @ 2016-05-09 17:09 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
I think this looks great, and I'm tempted to move towards
deprecating pandocfilters in favor of this (since I already
have too many packages to maintain).
Sergio, does it require python 3? If so, that might be a
reason for keeping pandocfilters around. Or is there a way
to make it compatible with python 2 as well?
+++ Sergio Correia [May 07 16 11:43 ]:
> Thanks to everyone's suggestions, I have added several useful features
> to panflute. At this point, I think the API is stable enough for
> production use (i.e. don't expect it to be different one year from
> now), and much more powerful and simpler that all the alternatives (at
> least if you use Python). Changes include:
> * A detailed website build with sphinx:
> http://scorreia.com/software/panflute/ . It includes examples,
> installation instructions (just run pip!), and the documentation.
> * Elements are now aware of their parents and siblings. Thus, you can
> do elem.parent , elem.next, etc.
> * I added a few elements (TableRow, TableCell) so working with tables
> and lists is way easier.
>
> Note that the examples might be useful even by themselves. They include
> adding CSV tables, "include" directives for other markdown files, etc.
> Cheers,
> S
> On Tuesday, April 26, 2016 at 1:12:31 AM UTC-4, Sergio Correia wrote:
>
> Dear all,
> After being a heavy user of pandocfilters.py for a few years, I wrote
> an alternative package (with a very similar API) that takes a more
> pythonic approach:
> * Elements are proper objects (with properties and methods) instead
> of dicts and lists
> * Elements can be created using named arguments: Header(Str('The'),
> Space, Str('Title'), level=1)
> * Batteries are included: I included functions that I ended up
> reusing through my different filters\
>
> The source and documentation is here: [1]https://github.com/
> sergiocorreia/panflute . It currently uses Python 3 but if there is
> demand from Python 2 users we could try a port.
> Ports of some of the existing filters are here: [2]https://github.com/
> sergiocorreia/panflute/tree/master/examples/panflute
> More examples will be placed here: [3]https://github.com/
> sergiocorreia/panflute-filters
> Feel free to comment here or on github; any suggestions or pull
> requests are more than welcome :)
> Best,
> Sergio
>
> --
> 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 [4]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to
> [5]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> [6]https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-
> af41-df0cf37ab7ea%40googlegroups.com.
> For more options, visit [7]https://groups.google.com/d/optout.
>
>References
>
> 1. https://github.com/sergiocorreia/panflute
> 2. https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
> 3. https://github.com/sergiocorreia/panflute-filters
> 4. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> 5. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> 6. https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-af41-df0cf37ab7ea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
> 7. https://groups.google.com/d/optout
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <20160509170931.GB3958-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
@ 2016-05-09 18:24 ` Sergio Correia
2016-11-29 13:34 ` Kolen Cheung
1 sibling, 0 replies; 19+ messages in thread
From: Sergio Correia @ 2016-05-09 18:24 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 4291 bytes --]
It uses py3 but there are only a few critical points (in the io.py file),
so if there is interest from py2 users I guess it can be ported in maybe a
couple dozen of lines. I am a bit reluctant to do the port though, as I
haven't been using py2 in a while and an active user might be more up to
date with its nuances (also, I don't know how many people are still using
py2 for this).
On Monday, May 9, 2016 at 1:09:44 PM UTC-4, John MacFarlane wrote:
>
> I think this looks great, and I'm tempted to move towards
> deprecating pandocfilters in favor of this (since I already
> have too many packages to maintain).
>
> Sergio, does it require python 3? If so, that might be a
> reason for keeping pandocfilters around. Or is there a way
> to make it compatible with python 2 as well?
>
> +++ Sergio Correia [May 07 16 11:43 ]:
> > Thanks to everyone's suggestions, I have added several useful features
> > to panflute. At this point, I think the API is stable enough for
> > production use (i.e. don't expect it to be different one year from
> > now), and much more powerful and simpler that all the alternatives (at
> > least if you use Python). Changes include:
> > * A detailed website build with sphinx:
> > http://scorreia.com/software/panflute/ . It includes examples,
> > installation instructions (just run pip!), and the documentation.
> > * Elements are now aware of their parents and siblings. Thus, you
> can
> > do elem.parent , elem.next, etc.
> > * I added a few elements (TableRow, TableCell) so working with
> tables
> > and lists is way easier.
> >
> > Note that the examples might be useful even by themselves. They
> include
> > adding CSV tables, "include" directives for other markdown files, etc.
> > Cheers,
> > S
> > On Tuesday, April 26, 2016 at 1:12:31 AM UTC-4, Sergio Correia wrote:
> >
> > Dear all,
> > After being a heavy user of pandocfilters.py for a few years, I wrote
> > an alternative package (with a very similar API) that takes a more
> > pythonic approach:
> > * Elements are proper objects (with properties and methods) instead
> > of dicts and lists
> > * Elements can be created using named arguments: Header(Str('The'),
> > Space, Str('Title'), level=1)
> > * Batteries are included: I included functions that I ended up
> > reusing through my different filters\
> >
> > The source and documentation is here: [1]https://github.com/
> > sergiocorreia/panflute . It currently uses Python 3 but if there is
> > demand from Python 2 users we could try a port.
> > Ports of some of the existing filters are here: [2]https://github.com/
> > sergiocorreia/panflute/tree/master/examples/panflute
> > More examples will be placed here: [3]https://github.com/
> > sergiocorreia/panflute-filters
> > Feel free to comment here or on github; any suggestions or pull
> > requests are more than welcome :)
> > Best,
> > Sergio
> >
> > --
> > 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 [4]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
> > To post to this group, send email to
> > [5]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
> > To view this discussion on the web visit
> > [6]
> https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-
> > af41-df0cf37ab7ea%40googlegroups.com.
> > For more options, visit [7]https://groups.google.com/d/optout.
> >
> >References
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/90b11812-b790-4593-9a4f-3228370b809d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 8390 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <20160509170931.GB3958-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-05-09 18:24 ` Sergio Correia
@ 2016-11-29 13:34 ` Kolen Cheung
1 sibling, 0 replies; 19+ messages in thread
From: Kolen Cheung @ 2016-11-29 13:34 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 4654 bytes --]
In the end, would pandocfilters be deprecating soon? I kind of worry the
amount of effort needed to port a filter from pandocfilters' to panflute's.
On Monday, May 9, 2016 at 10:09:44 AM UTC-7, John MacFarlane wrote:
>
> I think this looks great, and I'm tempted to move towards
> deprecating pandocfilters in favor of this (since I already
> have too many packages to maintain).
>
> Sergio, does it require python 3? If so, that might be a
> reason for keeping pandocfilters around. Or is there a way
> to make it compatible with python 2 as well?
>
> +++ Sergio Correia [May 07 16 11:43 ]:
> > Thanks to everyone's suggestions, I have added several useful features
> > to panflute. At this point, I think the API is stable enough for
> > production use (i.e. don't expect it to be different one year from
> > now), and much more powerful and simpler that all the alternatives (at
> > least if you use Python). Changes include:
> > * A detailed website build with sphinx:
> > http://scorreia.com/software/panflute/ . It includes examples,
> > installation instructions (just run pip!), and the documentation.
> > * Elements are now aware of their parents and siblings. Thus, you
> can
> > do elem.parent , elem.next, etc.
> > * I added a few elements (TableRow, TableCell) so working with
> tables
> > and lists is way easier.
> >
> > Note that the examples might be useful even by themselves. They
> include
> > adding CSV tables, "include" directives for other markdown files, etc.
> > Cheers,
> > S
> > On Tuesday, April 26, 2016 at 1:12:31 AM UTC-4, Sergio Correia wrote:
> >
> > Dear all,
> > After being a heavy user of pandocfilters.py for a few years, I wrote
> > an alternative package (with a very similar API) that takes a more
> > pythonic approach:
> > * Elements are proper objects (with properties and methods) instead
> > of dicts and lists
> > * Elements can be created using named arguments: Header(Str('The'),
> > Space, Str('Title'), level=1)
> > * Batteries are included: I included functions that I ended up
> > reusing through my different filters\
> >
> > The source and documentation is here: [1]https://github.com/
> > sergiocorreia/panflute . It currently uses Python 3 but if there is
> > demand from Python 2 users we could try a port.
> > Ports of some of the existing filters are here: [2]https://github.com/
> > sergiocorreia/panflute/tree/master/examples/panflute
> > More examples will be placed here: [3]https://github.com/
> > sergiocorreia/panflute-filters
> > Feel free to comment here or on github; any suggestions or pull
> > requests are more than welcome :)
> > Best,
> > Sergio
> >
> > --
> > 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 [4]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
> > To post to this group, send email to
> > [5]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
> > To view this discussion on the web visit
> > [6]
> https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-
> > af41-df0cf37ab7ea%40googlegroups.com.
> > For more options, visit [7]https://groups.google.com/d/optout.
> >
> >References
> >
> > 1. https://github.com/sergiocorreia/panflute
> > 2.
> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
> > 3. https://github.com/sergiocorreia/panflute-filters
> > 4. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
> > 5. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
> > 6.
> https://groups.google.com/d/msgid/pandoc-discuss/22e266e0-843e-4a87-af41-df0cf37ab7ea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
> > 7. https://groups.google.com/d/optout
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c2fb4566-6134-4d79-915b-56996db7523e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 11594 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <b6a8c6cf-cae7-403a-99e9-4e170a150428-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-07 18:43 ` Sergio Correia
@ 2016-12-01 12:23 ` Stefan Björk
[not found] ` <CABsBQU6JjXNC+8gWgVRg3w9zRZz7HTtVkrpDm7WUBU4EVOp3aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-14 4:47 ` Kolen Cheung
2 siblings, 1 reply; 19+ messages in thread
From: Stefan Björk @ 2016-12-01 12:23 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]
Thank you for this, Sergio. I wrote my first filter the other day
(converting inline LaTeX citations to pandoc citations) and I ended up
panflute, much thanks to your efforts to simplify things with proper
objects.
2016-04-26 7:12 GMT+02:00 Sergio Correia <sergio.correia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> Dear all,
>
> After being a heavy user of pandocfilters.py for a few years, I wrote an
> alternative package (with a very similar API) that takes a more pythonic
> approach:
>
>
> - Elements are proper objects (with properties and methods) instead of
> dicts and lists
> - Elements can be created using named arguments: Header(Str('The'),
> Space, Str('Title'), level=1)
> - Batteries are included: I included functions that I ended up reusing
> through my different filters\
>
> The source and documentation is here: https://github.com/
> sergiocorreia/panflute . It currently uses Python 3 but if there is
> demand from Python 2 users we could try a port.
>
> Ports of some of the existing filters are here: https://github.com/
> sergiocorreia/panflute/tree/master/examples/panflute
>
> More examples will be placed here: https://github.com/
> sergiocorreia/panflute-filters
>
> Feel free to comment here or on github; any suggestions or pull requests
> are more than welcome :)
>
> Best,
> Sergio
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CABsBQU6JjXNC%2B8gWgVRg3w9zRZz7HTtVkrpDm7WUBU4EVOp3aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 4270 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CABsBQU6JjXNC+8gWgVRg3w9zRZz7HTtVkrpDm7WUBU4EVOp3aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-12-01 17:13 ` Sergio Correia
[not found] ` <CABsBQU75O171c=+LJNT=ZZHQUeXRRNVnmcng9tkNFSrVouPnYg@mail.gmail.com>
0 siblings, 1 reply; 19+ messages in thread
From: Sergio Correia @ 2016-12-01 17:13 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2995 bytes --]
Great to hear that! Feel free to drop any feedback in the github page if
you have ideas on how to improve.
Cheers,
S
On Thursday, December 1, 2016 at 7:24:02 AM UTC-5, Stefan Björk wrote:
>
> Thank you for this, Sergio. I wrote my first filter the other day
> (converting inline LaTeX citations to pandoc citations) and I ended up
> panflute, much thanks to your efforts to simplify things with proper
> objects.
>
> 2016-04-26 7:12 GMT+02:00 Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> <javascript:>>:
>
>> Dear all,
>>
>> After being a heavy user of pandocfilters.py for a few years, I wrote an
>> alternative package (with a very similar API) that takes a more pythonic
>> approach:
>>
>>
>> - Elements are proper objects (with properties and methods) instead
>> of dicts and lists
>> - Elements can be created using named arguments: Header(Str('The'),
>> Space, Str('Title'), level=1)
>> - Batteries are included: I included functions that I ended up
>> reusing through my different filters\
>>
>> The source and documentation is here:
>> https://github.com/sergiocorreia/panflute . It currently uses Python 3
>> but if there is demand from Python 2 users we could try a port.
>>
>> Ports of some of the existing filters are here:
>> https://github.com/sergiocorreia/panflute/tree/master/examples/panflute
>>
>> More examples will be placed here:
>> https://github.com/sergiocorreia/panflute-filters
>>
>> Feel free to comment here or on github; any suggestions or pull requests
>> are more than welcome :)
>>
>> Best,
>> Sergio
>>
>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c67ed6c6-44e8-48d6-b0c1-7386e7b0ad44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 6820 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <CABsBQU75O171c=+LJNT=ZZHQUeXRRNVnmcng9tkNFSrVouPnYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-12-02 8:05 ` Stefan Björk
0 siblings, 0 replies; 19+ messages in thread
From: Stefan Björk @ 2016-12-02 8:05 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 3871 bytes --]
I need to improve my python skills. I'm a Perl hacker. 😉
Den 1 dec. 2016 6:13 em skrev "Sergio Correia" <sergio.correia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
Great to hear that! Feel free to drop any feedback in the github page if
you have ideas on how to improve.
Cheers,
S
On Thursday, December 1, 2016 at 7:24:02 AM UTC-5, Stefan Björk wrote:
> Thank you for this, Sergio. I wrote my first filter the other day
> (converting inline LaTeX citations to pandoc citations) and I ended up
> panflute, much thanks to your efforts to simplify things with proper
> objects.
>
> 2016-04-26 7:12 GMT+02:00 Sergio Correia <sergio....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>> Dear all,
>>
>> After being a heavy user of pandocfilters.py for a few years, I wrote an
>> alternative package (with a very similar API) that takes a more pythonic
>> approach:
>>
>>
>> - Elements are proper objects (with properties and methods) instead
>> of dicts and lists
>> - Elements can be created using named arguments: Header(Str('The'),
>> Space, Str('Title'), level=1)
>> - Batteries are included: I included functions that I ended up
>> reusing through my different filters\
>>
>> The source and documentation is here: https://github.com/sergi
>> ocorreia/panflute . It currently uses Python 3 but if there is demand
>> from Python 2 users we could try a port.
>>
>> Ports of some of the existing filters are here: https://github.com/sergi
>> ocorreia/panflute/tree/master/examples/panflute
>>
>> More examples will be placed here: https://github.com/sergi
>> ocorreia/panflute-filters
>>
>> Feel free to comment here or on github; any suggestions or pull requests
>> are more than welcome :)
>>
>> Best,
>> Sergio
>>
>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40go
>> oglegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/b6a8c6cf-cae7-403a-99e9-4e170a150428%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/
msgid/pandoc-discuss/c67ed6c6-44e8-48d6-b0c1-7386e7b0ad44%40googlegroups.com
<https://groups.google.com/d/msgid/pandoc-discuss/c67ed6c6-44e8-48d6-b0c1-7386e7b0ad44%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CABsBQU6c%2BgzfK1siu%3Dcdz1EAyATVwk1KeHiFOFwO6PkJuGrKiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 6130 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <b6a8c6cf-cae7-403a-99e9-4e170a150428-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-07 18:43 ` Sergio Correia
2016-12-01 12:23 ` Stefan Björk
@ 2016-12-14 4:47 ` Kolen Cheung
[not found] ` <5799849c-d315-48ac-8858-068f0d099dc1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2 siblings, 1 reply; 19+ messages in thread
From: Kolen Cheung @ 2016-12-14 4:47 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1375 bytes --]
Hi, all,
I am working on porting panflute to Python 2&3, it uses `pasteurize` with
minimum manual effort to make it work. However,
1. it probably means that the source and the package in PyPI will be
different (only the latter one is "pasteurized")
2. more testing is welcome
3. and there's a question of if there's enough need of panflute supporting
Python2 worth the effort
For the last point, @jgm has mentioned the thought of deprecating
pandocfilters. If Python 2 support means he can do so and get more time to
focus on more important things, it is an important factor to consider.
And another question for Sergio: since you have a lot of experience in both
pandocfilters and panflute, would it be possible to have some sort of
"porting guide" for pandocfilters to panflute migration?
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5799849c-d315-48ac-8858-068f0d099dc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 1942 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <5799849c-d315-48ac-8858-068f0d099dc1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-12-14 5:33 ` Sergio Correia
[not found] ` <86c756a1-40d9-4616-8c6d-e5ca4b2fa706-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 19+ messages in thread
From: Sergio Correia @ 2016-12-14 5:33 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1195 bytes --]
>
> And another question for Sergio: since you have a lot of experience in
> both pandocfilters and panflute, would it be possible to have some sort of
> "porting guide" for pandocfilters to panflute migration?
>
If at some point the official recommendation becomes to start using
panflute, I can surely add a porting guide. So far I haven't, partly
because I don't want to come off as pushing panflute too hard.
Ideally I would love to have a tool like 2to3 that allows conversion of
filters from pandocfilters to panflute, but write something like that would
probably be a *huge* undertaking (i.e. not worth it)
--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/86c756a1-40d9-4616-8c6d-e5ca4b2fa706%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 1836 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: panflute: a pythonic alternative to pandocfilters
[not found] ` <86c756a1-40d9-4616-8c6d-e5ca4b2fa706-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-12-18 2:13 ` Kolen Cheung
0 siblings, 0 replies; 19+ messages in thread
From: Kolen Cheung @ 2016-12-18 2:13 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1: Type: text/plain, Size: 138 bytes --]
Hi, just want to let you all knows that panflute now supports both py2 and py3 with the same installation method: `pip install panflute`.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2016-12-18 2:13 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 5:12 panflute: a pythonic alternative to pandocfilters Sergio Correia
[not found] ` <CAKGY2Pk8FYax5vwyh=Spzyi8gB9d95GkjV+5tNKLpenpC1Fgfw@mail.gmail.com>
[not found] ` <CAKGY2Pk8FYax5vwyh=Spzyi8gB9d95GkjV+5tNKLpenpC1Fgfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-26 9:36 ` Wagner Macedo
[not found] ` <CAKGY2Pk1j4MJnxKHpT4YZZkooJ-Kd05it9iGHFY1eNw7dPyjog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-26 15:00 ` Sergio Correia
[not found] ` <5ee6e6e1-8e2e-450d-b793-c0464e4be449-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-26 15:20 ` Wagner Macedo
[not found] ` <CAKGY2PmThM-67XiA9Yqy+KfY4MPJu9QN1dGpid3qS4zvz4=a+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-27 8:23 ` Samuel Coavoux
[not found] ` <bbc35e99-d664-45d4-b80a-a0847c298331-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-27 8:46 ` Sergio Correia
[not found] ` <6a0a11df-8825-4e0c-8582-948922e9f66b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-04-27 9:47 ` Samuel Coavoux
[not found] ` <CAFyE9YN5Hk0Enx02mzR2QtPoZ_7swo78KQoJMx+nUwmzksFnQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-27 11:43 ` Sergio Correia
2016-04-27 11:49 ` Wagner Macedo
[not found] ` <b6a8c6cf-cae7-403a-99e9-4e170a150428-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-07 18:43 ` Sergio Correia
[not found] ` <22e266e0-843e-4a87-af41-df0cf37ab7ea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-09 17:09 ` John MacFarlane
[not found] ` <20160509170931.GB3958-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-05-09 18:24 ` Sergio Correia
2016-11-29 13:34 ` Kolen Cheung
2016-12-01 12:23 ` Stefan Björk
[not found] ` <CABsBQU6JjXNC+8gWgVRg3w9zRZz7HTtVkrpDm7WUBU4EVOp3aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-01 17:13 ` Sergio Correia
[not found] ` <CABsBQU75O171c=+LJNT=ZZHQUeXRRNVnmcng9tkNFSrVouPnYg@mail.gmail.com>
[not found] ` <CABsBQU75O171c=+LJNT=ZZHQUeXRRNVnmcng9tkNFSrVouPnYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-02 8:05 ` Stefan Björk
2016-12-14 4:47 ` Kolen Cheung
[not found] ` <5799849c-d315-48ac-8858-068f0d099dc1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-14 5:33 ` Sergio Correia
[not found] ` <86c756a1-40d9-4616-8c6d-e5ca4b2fa706-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-18 2:13 ` Kolen Cheung
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).