asciidoc-* tags and dblatex (proposed changes)

65 views
Skip to first unread message

Mark Fernandes

unread,
Jul 3, 2009, 4:36:18 PM7/3/09
to asci...@googlegroups.com
Hi Stuart,

I like the new 'asciidoc-*' tags because they permit extending
AsciiDoc while maintaining consistency with DocBook and avoid
confusion because they are readily understood as being
AsciiDoc specific.

Since I use dblatex, instead of FOP, to generate pdf, I discovered
the <asciidoc-*> tags by themselves cause problems that do not go away
unless wrapped inside <simpara> </simpara> tags.

In future, I think it might be a good idea to wrap any '<asciidoc-*>'
tags within '<simpara>...</simpara>' tags, otherwise the
processing-instruction does not work in dblatex (I am using the latest
released version of dblatex 0.2.11)

Thank you for all the work you do on AsciiDoc, and I hope you accept
this contribution (under any license you choose). I have not checked
these changes with FOP so I do not know whether they work or not.

Mark Fernandes.

Here are my suggested changes to the two files: docbook.conf and
dblatex/asciidoc-dblatex.xsl.

Changes in docbook.conf
-----------------------

[ruler-blockmacro]
# Uses a custom processing instruction in asciidoc-dblatex.xsl.
<simpara><?asciidoc-hr?></simpara>

[pagebreak-blockmacro]
# Uses a custom processing instruction in asciidoc-dblatex.xsl.
<simpara><?asciidoc-pagebreak?></simpara>


Additions to dblatex/asciidoc-dblatex.xsl
-----------------------------------------

<xsl:template match="processing-instruction('asciidoc-pagebreak')">
<!-- force hard pagebreak, varies from 0(low) to 4(high) -->
<xsl:text>\pagebreak[4] </xsl:text>
<xsl:apply-templates />
<xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="processing-instruction('asciidoc-br')">
<xsl:text>\newline&#10;</xsl:text>
</xsl:template>

<xsl:template match="processing-instruction('asciidoc-hr')">
<!-- draw a 444 pt line (centered) -->
<xsl:text>\begin{center}&#10; </xsl:text>
<xsl:text>\line(1,0){444}&#10; </xsl:text>
<xsl:text>\end{center}&#10; </xsl:text>
</xsl:template>

Stuart Rackham

unread,
Jul 5, 2009, 8:45:57 PM7/5/09
to asci...@googlegroups.com
Hi Mark

Thank you for this patch, it works really well (I'm on dblatex 0.2.9)
and was sorely needed. The simpara tags don't seem to affect the FOP
processing.

Have added it to the trunk:
http://hg.sharesource.org/asciidoc/rev/23e24be28075


Cheers, Stuart
Reply all
Reply to author
Forward
0 new messages