aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2017-04-27 14:40:09 +0200
committerLars Thorsen <[email protected]>2017-04-27 14:40:09 +0200
commite42a9ecec5f61af2bb3e8e1ea2884112bd4203c0 (patch)
tree9ac9e9cb18fd986f4bb88f309bbcbe2d833b60b9
parent74149d797864cb2de1b4d2b58292d27a4f7895ae (diff)
parentd1e80ea77af33307fcb672d7c5aa386172c8a789 (diff)
downloadotp-e42a9ecec5f61af2bb3e8e1ea2884112bd4203c0.tar.gz
otp-e42a9ecec5f61af2bb3e8e1ea2884112bd4203c0.tar.bz2
otp-e42a9ecec5f61af2bb3e8e1ea2884112bd4203c0.zip
Merge branch 'lars/erl_docgen/sort-c-functions/OTP-14333'
* lars/erl_docgen/sort-c-functions/OTP-14333: [erl_docgen] Update the reference manual function name sort
-rw-r--r--lib/erl_docgen/priv/xsl/db_html.xsl23
-rw-r--r--lib/erl_docgen/vsn.mk2
2 files changed, 18 insertions, 7 deletions
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl
index 4c7df1d1a0..6eafa2a165 100644
--- a/lib/erl_docgen/priv/xsl/db_html.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html.xsl
@@ -66,6 +66,10 @@
Additionally, callbacks may be included, as in gen_server.xml:
<name>Module:handle_call(Request, From, State) -> Result</name>
+ For C reference pages the name tag has a substructure where the nametext tag
+ is used in the sort, as in erl_nif.xml
+ <name><ret>void *</ret><nametext>enif_alloc(size_t size)</nametext></name>
+
So first, get the name from either the attribute or the element value.
Then, reverse the case of the first character. This is because xsltproc, used for processing,
orders uppercase before lowercase (even when the 'case-order="lower-first"' option
@@ -82,12 +86,19 @@
<xsl:variable name="base">
<xsl:choose>
- <xsl:when test="string-length($elem/@name) > 0">
- <xsl:value-of select="$elem/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$elem"/>
- </xsl:otherwise>
+ <xsl:when test="ancestor::cref">
+ <xsl:value-of select="$elem/nametext"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="string-length($elem/@name) > 0">
+ <xsl:value-of select="$elem/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$elem"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
</xsl:choose>
</xsl:variable>
diff --git a/lib/erl_docgen/vsn.mk b/lib/erl_docgen/vsn.mk
index d6106a2823..8fad061b26 100644
--- a/lib/erl_docgen/vsn.mk
+++ b/lib/erl_docgen/vsn.mk
@@ -1 +1 @@
-ERL_DOCGEN_VSN = 0.6.1
+ERL_DOCGEN_VSN = 0.7