Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
One of the authors for Manning, Craig Walls, discovered a new requirement while customizing the Asciidoctor DocBook templates to fit the XML schema that Manning requires.
Asciidoctor renders each block using discrete templates. To fit the Manning schema, the listing and callout list blocks need to be handled by the same template so the output is wrapped by an outer XML element. Here's how Craig describes the requirement and his solution. (Keep in mind, the "deficiency" isn't a defect in Asciidoctor, but rather a deficiency in the context of their use case).
I just sent a pull request that shows how this can be done within the template.
This is an interesting use case that I had never thought of before. Each of the block elements are isolated to their own template. In this case, two sibling blocks need to be handled by the same template, and the callout block needs to be skipped where it would normally be rendered.
While my patch demonstrates that this is possible today, I realize that additional locator methods on the node object (Asciidoctor::Block) as well as a flag to mark a block as rendered would make this customization much easier.
Here's the really great news from the subtext of this case study:
Cheers, -Dan p.s. I'm planning on creating a set of standalone ERB templates for the docbook output so it's less work to fork and customize (so far I only have ERB templates for the HTML output). If you are willing to use either Haml or Slim, I already have complete sets for those template languages. You can find them here:
Dan Allen | http://google.com/profiles/dan.j.allen
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
This reminds me of the discussion with Emmanuel. If its terrible that AsciiDoc supports two ways of doing things, DocBook brings it to a whole new level with their massively relaxed schema. — Sent from Mailbox for iPhone On Thu, Jun 6, 2013 at 12:22 AM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] |
Free forum by Nabble | Edit this page |