Login  Register

Re: Creating tables in extensions

Posted by mojavelinux on Apr 26, 2019; 6:36pm
URL: https://discuss.asciidoctor.org/Creating-tables-in-extensions-tp6875p6876.html

The table AST really wasn't designed as a public-facing API. The best way to do it at the moment is to generate AsciiDoc, then use the parse_content method to parse it into a block. You can see that being done in this extension: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/textql-block.rb

Cheers,

-Dan

On Fri, Apr 26, 2019 at 10:32 AM lorrden [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I cannot figure out how to create a table in an extension. Does anyone have any pointers for how to do this?

I want to create a block macro extension that automatically creates an Asciidoctor table in the AST, and it should work with both the html, docbook and pdf output (through Asciidoctor-pdf).

I have been able to create small text fragments and other items, but not tables.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Creating-tables-in-extensions-tp6875.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux