aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen/priv/xsl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_docgen/priv/xsl')
-rw-r--r--lib/erl_docgen/priv/xsl/db_html.xsl121
-rw-r--r--lib/erl_docgen/priv/xsl/db_man.xsl12
-rw-r--r--lib/erl_docgen/priv/xsl/db_pdf.xsl26
3 files changed, 109 insertions, 50 deletions
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl
index 4db71cf92f..fe6c7d3c28 100644
--- a/lib/erl_docgen/priv/xsl/db_html.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html.xsl
@@ -448,9 +448,7 @@
</xsl:choose>
</xsl:when>
<xsl:otherwise> <!-- <datatype> with <name> -->
- <span class="bold_code">
- <xsl:apply-templates/>
- </span>
+ <xsl:call-template name="name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@@ -852,39 +850,36 @@
<!-- Book -->
<xsl:template match="/book">
-
- <xsl:apply-templates name="parts"/>
- <xsl:apply-templates name="applications"/>
-
+ <xsl:apply-templates select="parts"/>
+ <xsl:apply-templates select="applications"/>
+ <xsl:apply-templates select="releasenotes"/>
</xsl:template>
<!-- Parts -->
<xsl:template match="parts">
- <xsl:apply-templates name="part"/>
+ <xsl:apply-templates select="part"/>
</xsl:template>
<!-- Applications -->
<xsl:template match="applications">
- <xsl:apply-templates name="application"/>
+ <xsl:apply-templates select="application"/>
</xsl:template>
-
<!-- Header -->
- <xsl:template match="header">
- </xsl:template>
-
- <!-- Section/Title -->
- <xsl:template match="section/title">
- </xsl:template>
-
- <xsl:template match="pagetext">
- </xsl:template>
+ <xsl:template match="header"/>
+
+ <!-- Section/Title -->
+ <xsl:template match="section/title"/>
+ <xsl:template match="pagetext"/>
- <!-- Chapter/Section -->
+ <!-- Chapter/Section, subsection level 1-->
<xsl:template match="chapter/section">
<xsl:param name="chapnum"/>
<h3>
+ <xsl:for-each select="marker">
+ <xsl:call-template name="marker-before-title"/>
+ </xsl:for-each>
<a name="{generate-id(title)}">
<xsl:value-of select="$chapnum"/>.<xsl:number/>&#160;
<xsl:value-of select="title"/>
@@ -896,11 +891,14 @@
</xsl:apply-templates>
</xsl:template>
- <!-- Subsections lvl 3 and ... -->
+ <!-- Subsections lvl 2 -->
<xsl:template match="section/section">
<xsl:param name="chapnum"/>
<xsl:param name="sectnum"/>
<h4>
+ <xsl:for-each select="marker">
+ <xsl:call-template name="marker-before-title"/>
+ </xsl:for-each>
<!-- xsl:value-of select="$partnum"/>.<xsl:value-of select="$chapnum"/>.<xsl:value-of select="$sectnum"/>.<xsl:number/ -->
<xsl:value-of select="title"/>
</h4>
@@ -909,10 +907,29 @@
</xsl:apply-templates>
</xsl:template>
+ <!-- Subsections lvl 3 and ... -->
+ <xsl:template match="section/section/section">
+ <xsl:param name="chapnum"/>
+ <xsl:param name="sectnum"/>
+ <h5>
+ <xsl:for-each select="marker">
+ <xsl:call-template name="marker-before-title"/>
+ </xsl:for-each>
+ <!-- xsl:value-of select="$partnum"/>.<xsl:value-of select="$chapnum"/>.<xsl:value-of select="$sectnum"/>.<xsl:number/ -->
+ <xsl:value-of select="title"/>
+ </h5>
+ <xsl:apply-templates>
+ <xsl:with-param name="chapnum" select="$chapnum"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
<!-- *ref/Section -->
<xsl:template match="erlref/section|cref/section|comref/section|fileref/section|appref/section">
<xsl:param name="chapnum"/>
<h3>
+ <xsl:for-each select="marker">
+ <xsl:call-template name="marker-before-title"/>
+ </xsl:for-each>
<a name="{generate-id(title)}">
<xsl:value-of select="title"/>
</a>
@@ -940,7 +957,6 @@
<!-- Lists -->
-
<xsl:template match="list">
<xsl:param name="chapnum"/>
<ul>
@@ -1048,6 +1064,18 @@
</div>
</xsl:template>
+ <!-- Quote -->
+ <xsl:template match="quote">
+ <xsl:param name="chapnum"/>
+ <div class="quote">
+ <p>
+ <xsl:apply-templates>
+ <xsl:with-param name="chapnum" select="$chapnum"/>
+ </xsl:apply-templates>
+ </p>
+ </div>
+ </xsl:template>
+
<!-- Paragraph -->
<xsl:template match="p">
<p>
@@ -1056,10 +1084,6 @@
</xsl:template>
<!-- Inline elements -->
- <xsl:template match="b">
- <strong><xsl:apply-templates/></strong>
- </xsl:template>
-
<xsl:template match="i">
<i><xsl:apply-templates/></i>
</xsl:template>
@@ -1076,6 +1100,10 @@
<strong><xsl:apply-templates/></strong>
</xsl:template>
+ <xsl:template match="strong">
+ <strong><xsl:apply-templates/></strong>
+ </xsl:template>
+
<!-- Code -->
<xsl:template match="code">
<xsl:param name="chapnum"/>
@@ -1162,11 +1190,11 @@
<xsl:param name="chapnum"/>
<xsl:param name="fignum"/>
- <em>Figure
+ <p><em>Figure
<xsl:value-of select="$chapnum"/>.<xsl:value-of select="$fignum"/>:
&#160;
<xsl:apply-templates/>
- </em>
+ </em></p>
</xsl:template>
@@ -1353,9 +1381,7 @@
<xsl:with-param name="type">ref_man</xsl:with-param>
</xsl:call-template-->
-
<xsl:document href="{$outdir}/index.html" method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN">
-
<xsl:call-template name="pagelayout"/>
</xsl:document>
</xsl:template>
@@ -1922,6 +1948,7 @@
</xsl:choose>
</xsl:template>
+ <!-- Used both in <datatype> and in <func>! -->
<xsl:template name="name">
<xsl:variable name="tmpstring">
@@ -1978,7 +2005,14 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <a name="{$fname}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
+ <xsl:choose>
+ <xsl:when test="ancestor::datatype">
+ <a name="type-{$fname}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
+ </xsl:when>
+ <xsl:otherwise>
+ <a name="{$fname}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
<span class="bold_code"><xsl:value-of select="."/></span>
@@ -2064,7 +2098,7 @@
</xsl:template>
<xsl:template match="seealso">
- <xsl:call-template name="seealso"/>
+ <xsl:call-template name="seealso"/>
</xsl:template>
<xsl:template name="seealso">
@@ -2146,16 +2180,27 @@
</xsl:template>
-
<xsl:template match="url">
<span class="bold_code"><a href="{@href}"><xsl:apply-templates/></a></span>
</xsl:template>
-
<xsl:template match="marker">
- <a name="{@id}"><xsl:apply-templates/></a>
+ <xsl:choose>
+ <xsl:when test="not(parent::section and following-sibling::title)">
+ <a name="{@id}"><xsl:apply-templates/></a>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="marker-before-title">
+ <xsl:choose>
+ <xsl:when test="self::marker and parent::section and following-sibling::title">
+ <a name="{@id}"><xsl:apply-templates/></a>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
+
<xsl:template match="term">
<xsl:value-of select="@id"/>
<!-- xsl:choose>
@@ -2434,7 +2479,11 @@
<xsl:template name="nl">
<xsl:text>
-</xsl:text>
+ </xsl:text>
+ </xsl:template>
+
+ <xsl:template match="seealso//text()">
+ <xsl:value-of select="normalize-space(.)"/>
</xsl:template>
</xsl:stylesheet>
diff --git a/lib/erl_docgen/priv/xsl/db_man.xsl b/lib/erl_docgen/priv/xsl/db_man.xsl
index f75615c105..03b6b0691d 100644
--- a/lib/erl_docgen/priv/xsl/db_man.xsl
+++ b/lib/erl_docgen/priv/xsl/db_man.xsl
@@ -589,12 +589,6 @@
</xsl:template>
<!-- Inline elements -->
- <xsl:template match="b">
- <xsl:text>\fB</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>\fR\&amp; </xsl:text>
- </xsl:template>
-
<xsl:template match="i">
<xsl:text>\fI</xsl:text>
<xsl:apply-templates/>
@@ -622,6 +616,12 @@
<xsl:text>\fI</xsl:text> <xsl:apply-templates/><xsl:text>\fR\&amp;</xsl:text>
</xsl:template>
+ <xsl:template match="strong">
+ <xsl:text>\fB</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>\fR\&amp; </xsl:text>
+ </xsl:template>
+
<xsl:template match="seealso">
<xsl:choose>
<xsl:when test="ancestor::head">
diff --git a/lib/erl_docgen/priv/xsl/db_pdf.xsl b/lib/erl_docgen/priv/xsl/db_pdf.xsl
index e5e624ac4c..99263847fb 100644
--- a/lib/erl_docgen/priv/xsl/db_pdf.xsl
+++ b/lib/erl_docgen/priv/xsl/db_pdf.xsl
@@ -1171,6 +1171,16 @@
</fo:block>
</xsl:template>
+ <!-- Quote -->
+ <xsl:template match="quote">
+ <xsl:param name="chapnum"/>
+ <fo:block font-style="italic">
+ <xsl:apply-templates>
+ <xsl:with-param name="chapnum" select="$chapnum"/>
+ </xsl:apply-templates>
+ </fo:block>
+ </xsl:template>
+
<!-- Paragraph -->
<xsl:template match="p">
<fo:block xsl:use-attribute-sets="p">
@@ -1180,14 +1190,8 @@
<!-- Inline elements -->
- <xsl:template match="b">
- <fo:inline font-weight="bold">
- <xsl:apply-templates/>
- </fo:inline>
- </xsl:template>
-
<xsl:template match="i">
- <fo:inline font-weight="italic">
+ <fo:inline font-style="italic">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
@@ -1203,7 +1207,13 @@
</xsl:template>
<xsl:template match="em">
- <fo:inline font-style="italic">
+ <fo:inline font-weight="bold">
+ <xsl:apply-templates/>
+ </fo:inline>
+ </xsl:template>
+
+ <xsl:template match="strong">
+ <fo:inline font-weight="bold">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>