Block macro processor output

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Block macro processor output

Hello, let me start to explain what I am trying to do. I want to transform an XML file into AsciiDoc format instead of adding as source code. Basically I would like to do next thing:

Given an xml like:


And next adoc file:


= First Section




render to an html which instead of having the xml embed as source code, had something like:


<p class="paragraph">


So my first idea was to create a BlockProcessor extension which basically do next:

Map<String, Object> options = new HashMap<String, Object>() {{
            put("content_model", ":simple");
        return createBlock(parent, "paragraph", "*mytext*", attributes, options); <1>
<1> Note that the output is in AsciiDoc format

But the problem is that BlockMacroProcessor extension passes the paragraph directly to output, so instead of passing *mytext* I should send "mytext" in html. But this would be a problem because if the output is not an html, (for example a pdf) the extension would not work.

I have been thinking creating an IncludeProcessor extension:


So now I will be able to push data to reader and be able to send text in AsciiDoc format.

Do you think it would be useful to have an extension as a mix between include and block macro extension?