Skip to content

Commit

Permalink
Work around doxy weirdness with more template weirdness.
Browse files Browse the repository at this point in the history
Avoid leaving floating text elements inside sections.
  • Loading branch information
jcarrano committed Apr 24, 2019
1 parent 682e68c commit 86cd1bd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions antidox/templates/compound.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@
<section>
<xsl:attribute name="ids"><xsl:value-of select="@id"/></xsl:attribute>
<title><xsl:apply-templates select="title/text()"/></title>
<xsl:apply-templates/>
<xsl:apply-templates select="para[not(preceding::heading or descendant::heading)]|
para[descendant::heading]/child::*[not(preceding::heading or self::heading)]"/>
<xsl:apply-templates select="para/heading[@level=1]|sect1|sect2"/>
</section>
</xsl:template>

Expand Down Expand Up @@ -194,13 +196,19 @@
<!-- Small workaround for trailing whitespace in titles -->
<title><xsl:value-of select="normalize-space(.)"/></title>
<xsl:apply-templates
select="parent::*/following-sibling::para[not(descendant::heading) and generate-id(preceding::heading[1])=$heading]|
parent::*/following-sibling::para[descendant::heading]/*[not(self::heading) and generate-id(preceding::heading[1])=$heading]|
parent::*/following-sibling::*/heading[number(@level)=($level+1) and generate-id(preceding::heading[$level=number(@level)][1])=$heading]"/>
select="parent::*/following-sibling::para[not(descendant::heading) and generate-id(preceding::heading[1])=$heading]" />
<paragraph>
<xsl:apply-templates
select="parent::*/following-sibling::para[descendant::heading]/*[not(self::heading) and generate-id(preceding::heading[1])=$heading]"/>
</paragraph>
<xsl:apply-templates
select="parent::*/following-sibling::*/heading[number(@level)=($level+1) and generate-id(preceding::heading[$level=number(@level)][1])=$heading]"/>
</section>
</xsl:if>
</xsl:template>

<!-- Prevents losing lose text when applying rule 1.1 described above. -->

<xsl:template match="type">
<desc_type><xsl:apply-templates/></desc_type>
</xsl:template>
Expand Down Expand Up @@ -345,7 +353,7 @@ parent::*/following-sibling::*/heading[number(@level)=($level+1) and generate-id
</field_list>
</xsl:template>

<xsl:template match="detaileddescription">
<xsl:template match="memberdef/detaileddescription">
<xsl:apply-templates/>
<xsl:if test="descendant::simplesect[@kind='return']">
<rubric><xsl:text>Return values</xsl:text></rubric>
Expand Down

0 comments on commit 86cd1bd

Please sign in to comment.