On Sat, 24 Nov 2018 at 09:43, <[email protected]> wrote: > > I'm working on a filter to generate tables using text tables as an input. > I've implemented a basic parser that generates html output. However when it > came to creating the filter conf file, I'm a little stuck. > > I used the sample filter as a guide to come up with the following conf: > > [blockdef-listing] > txtbl-style=template="openblock",presubs=(),postsubs=(),posattrs=("style"),filter="txtbl.py" > > This generates the table, but will force me to do all the styling. I tried > using the table as the style template, but it places the table tags in the > wrong section of the genrated (html) document. Is there anyway, I can place > it in the tbody section of the document?
I think tables are "special" because of the complexity of their syntax, they are not treated as standard blocks and their templates are used in a different way, so they are not intended to be used as normal templates in styles. So I'm not surprised it does strange things if you try to use it as a template for a style. Also filters are generally intended to do the styling, think of the standard filters like source code, or music. I think what you are looking for is something that allows you to parse the table using a filter then use asciidoc to markup the contents? Asciidoc Python is not reentrant (it has global stuff everywhere), so you can't call Asciidoc itself from the filter, it has to be spawned as a separate process and that is what tables do if the style is 'a' https://github.com/asciidoc/asciidoc-py3/blob/618f6e6f6b558ed1e5f2588cd60a5a6b4f881ca0/asciidoc.conf#L567. You could probably do that from your filter, although its an expensive way to do it (running an asciidoc process for each cell). Cheers Lex > > Thanks. > > DJ > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/asciidoc. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/asciidoc. For more options, visit https://groups.google.com/d/optout.
