mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 02:43:58 +00:00
Fix the <pre> block workaround in doxygen2boostbook.xsl
It turns out the '\code' blocks don't have this problem, so an easier fix would be just to use them. But now I've implemented the workaround, might as well leave it in, in case anyone wants to use <pre> blocks in the future.
This commit is contained in:
parent
30911053b5
commit
f1aef5c98e
@ -63,8 +63,22 @@ Embedded docbook list:</para><para>
|
||||
<listitem><para>Second list item</para></listitem>
|
||||
</itemizedlist>
|
||||
Line 1<sbr/>
|
||||
Line 2</para><para><programlisting language="c++">void foo() {}
|
||||
</programlisting></para><para>
|
||||
Line 2</para><para><programlisting language="c++">void foo() {}
|
||||
void foo2() {}
|
||||
</programlisting></para><para><programlisting language="c++">void bar() {}
|
||||
|
||||
void bar2() {}
|
||||
</programlisting></para><para>Alternative way of writing code, has a complicated workaround because doxygen treats the empty line as a paragraph separator:</para><programlisting>
|
||||
int bar();
|
||||
|
||||
int bar2();
|
||||
</programlisting><para>Unfortunately the workaround will merge consecutive blocks, like this:</para><programlisting>
|
||||
int foo();
|
||||
|
||||
|
||||
|
||||
int foo2();
|
||||
</programlisting><para>
|
||||
</para></description></struct><struct name="specialization_test"><template>
|
||||
<template-type-parameter name="T"/>
|
||||
</template></struct><struct-specialization name="specialization_test"><template>
|
||||
|
@ -153,8 +153,36 @@ namespace example
|
||||
*
|
||||
* \code
|
||||
* void foo() {}
|
||||
* void foo2() {}
|
||||
* \endcode
|
||||
*
|
||||
* \code
|
||||
* void bar() {}
|
||||
*
|
||||
* void bar2() {}
|
||||
* \endcode
|
||||
*
|
||||
* Alternative way of writing code, has a complicated workaround
|
||||
* because doxygen treats the empty line as a paragraph
|
||||
* separator:
|
||||
*
|
||||
* <pre>
|
||||
* int bar();
|
||||
*
|
||||
* int bar2();
|
||||
* </pre>
|
||||
*
|
||||
* Unfortunately the workaround will merge consecutive blocks,
|
||||
* like this:
|
||||
*
|
||||
* <pre>
|
||||
* int foo();
|
||||
* </pre>
|
||||
*
|
||||
* <pre>
|
||||
* int foo2();
|
||||
* </pre>
|
||||
*
|
||||
* \tparam TypeParameter A template parameter
|
||||
* \tparam NonTypeParameter This is a non-type template parameter
|
||||
* \tparam TypeParameterWithDefault This is a template parameter with a default argument
|
||||
|
@ -1726,11 +1726,11 @@
|
||||
|
||||
<!-- Adjacent para nodes' children.
|
||||
Based on code at: http://stackoverflow.com/a/2092144 -->
|
||||
<xsl:variable name="program_paragraphs" select="following-sibling::para[preformatted][count(preformatted)=count(*)]" />
|
||||
<xsl:variable name="following-siblings" select="following-sibling::*" />
|
||||
<xsl:for-each select="following-sibling::para[preformatted][count(preformatted)=count(*)]">
|
||||
<xsl:variable name="index" select="position()"/>
|
||||
<xsl:if test="generate-id(.)=generate-id($program_paragraphs[$index])">
|
||||
<xsl:text>
</xsl:text>
|
||||
<xsl:if test="generate-id(.)=generate-id($following-siblings[$index])">
|
||||
<xsl:text>

</xsl:text>
|
||||
<xsl:apply-templates mode="passthrough" select="./preformatted/node()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
Loading…
x
Reference in New Issue
Block a user