diff options
author | Hans Bolinder <[email protected]> | 2012-02-07 09:25:12 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2012-02-07 09:25:12 +0100 |
commit | 8853793b0edd01947829840f90c91a1e2468cc36 (patch) | |
tree | c45d1a987f4af483b4a1059b09999455f56da8ac /lib | |
parent | 0c399a77db7eba81f13baccb1f19517991619f4e (diff) | |
parent | 8d59a1fc518719c8c445d9d94b23c173c18b4438 (diff) | |
download | otp-8853793b0edd01947829840f90c91a1e2468cc36.tar.gz otp-8853793b0edd01947829840f90c91a1e2468cc36.tar.bz2 otp-8853793b0edd01947829840f90c91a1e2468cc36.zip |
Merge branch 'maint'
* maint:
[erl_docgen] Optimize generation of HTML
Diffstat (limited to 'lib')
-rw-r--r-- | lib/erl_docgen/priv/xsl/db_html.xsl | 66 |
1 files changed, 60 insertions, 6 deletions
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl index 4f6c758e7b..7cf5465f90 100644 --- a/lib/erl_docgen/priv/xsl/db_html.xsl +++ b/lib/erl_docgen/priv/xsl/db_html.xsl @@ -555,6 +555,23 @@ <!-- End of Dialyzer type/spec tags --> + <!-- Cache for each module all the elements used for navigation. --> + <xsl:variable name="erlref.nav" select="exsl:node-set($erlref.nav_rtf)"/> + + <xsl:variable name="erlref.nav_rtf"> + <xsl:for-each select="//erlref"> + <xsl:variable name="cval" select="module"/> + <xsl:variable name="link_cval"><xsl:value-of select="translate($cval, '­', '')"/></xsl:variable> + <module name="{$cval}"> + <xsl:call-template name="menu.funcs"> + <xsl:with-param name="entries" select="funcs/func/name"/> + <xsl:with-param name="cval" select="$cval"/> + <xsl:with-param name="basename" select="$link_cval"/> + </xsl:call-template> + </module> + </xsl:for-each> + </xsl:variable> + <!-- Page layout --> <xsl:template name="pagelayout"> <xsl:param name="chapnum"/> @@ -1324,12 +1341,25 @@ Top of manual page </a> </li> - <xsl:call-template name="menu.funcs"> - <xsl:with-param name="entries" - select="funcs/func/name"/> - <xsl:with-param name="basename"><xsl:value-of select="$link_cval"/></xsl:with-param> - <xsl:with-param name="cval" select="$cval"/> - </xsl:call-template> + <xsl:call-template name="nl"/> + <xsl:choose> + <xsl:when test="local-name() = 'erlref'"> + <!-- Use the cached value in order to save time. + value-of a string node is _much_ faster than + copy-of a rtf --> + <xsl:value-of + disable-output-escaping="yes" + select="$erlref.nav/module[@name = $cval]"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="menu.funcs"> + <xsl:with-param name="entries" + select="funcs/func/name"/> + <xsl:with-param name="basename"><xsl:value-of select="$link_cval"/></xsl:with-param> + <xsl:with-param name="cval" select="$cval"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> </ul> </li> </xsl:when> @@ -1456,11 +1486,30 @@ <!-- Skip. Only works for Dialyzer specs. --> </xsl:when> <xsl:otherwise> +<!-- <li title="{$fname}-{$arity}"> <a href="{$basename}.html#{$fname}-{$arity}"> <xsl:value-of select="$fname"/>/<xsl:value-of select="$arity"/> </a> </li> +--> + <!-- Generate a text node --> + <xsl:text><li title="</xsl:text> + <xsl:value-of select="$fname"/> + <xsl:text>-</xsl:text> + <xsl:value-of select="$arity"/> + <xsl:text>"><a href="</xsl:text> + <xsl:value-of select="$basename"/> + <xsl:text>.html#</xsl:text> + <xsl:value-of select="$fname"/> + <xsl:text>-</xsl:text> + <xsl:value-of select="$arity"/> + <xsl:text>"></xsl:text> + <xsl:value-of select="$fname"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$arity"/> + <xsl:text></a></li></xsl:text> + <xsl:call-template name="nl"/> </xsl:otherwise> </xsl:choose> </xsl:when> @@ -2226,4 +2275,9 @@ </xsl:template> + <xsl:template name="nl"> + <xsl:text> +</xsl:text> + </xsl:template> + </xsl:stylesheet> |