Thanks John, Kolen. @Kolen, my use-case is simple. I have users of my filter to describe "situation". The "situation" description itself is free-flow (can use any markdown foramtting scheme and such, except the description itself not contain markdown header). The "situation" is associated with one or more "tags". My current idea is to use the
...
block container to describe the "situation. And the "tags" are annotated as div-kvs. In the filter, i would like to create a table for each "situation". The table should look like the following +------------------------------------+-----------------------------------------+ | Situation Name | | +------------------------------------+-----------------------------------------+ | Tag1 Key | Tag1 Value | +------------------------------------+-----------------------------------------+ | Tag2 Key | Tag2 Value | +------------------------------------+-----------------------------------------+ Hence, i require to generate a table for each div with ['situation' in div.classes]. Any comments/suggestion in my approach is welcome. Thanks and with best regards, Nizam On Sun, Nov 5, 2017 at 4:35 AM, John MacFarlane wrote: > If you're using the pandocfilters library, I suggest you > check out the alternative library panflute, which is more > pythonic and easier to use. > > +++ Nizamudheen Ahmed [Nov 04 17 08:34 ]: > >> Hi folks, >> I am new to Pandoc. I am trying to write a filter using Python. I >> wanted to create and return a "Table" as part of the filter function. I >> understood that the Table constructor takes 5 arguments. But the >> details of them (at least from the Python parlance) are not available. >> My novice code to construct the Table looked like the following >> tab_le = Table ([Str("This is the title of the table")], # >> Table caption? >> ["left", "left"], # Alignment? >> [0.5, 0.5], # Relative width of the >> columns? >> [Str("C1"), Str("C2")], #Column Header >> name? >> [ # Table rows? >> [Str("A1"), Str("B1")], >> [Str("A2"), Str("B2")], >> [Str("A3"), Str("B3")] >> ] ); >> With that code, i get the following error >> >>>> >> Error in $[373][0]: expected Object, encountered String >> <<<<< >> I am sure i am grossly off in the constructor. Can someone help me to >> create Table? >> Thanks and with best regards, >> Nizam >> >> -- >> 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/1be02d85-bd95-4709- >> 82f8-f6a5460930c6%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/1be02d85-bd >> 95-4709-82f8-f6a5460930c6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email& >> utm_source=footer >> 4. 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/to > pic/pandoc-discuss/OBlbFj5HJ9I/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/ms > gid/pandoc-discuss/20171104230532.GC97257%40Johns-MacBook-Pro.local. > > 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/CA%2BzEWHCd%2BEGXRoWsJcxk0hb_fn2JpWsmVuCnmKJz5ge6FzFCjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.