~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/erl_docgen/priv/xsl/db_html.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!--      
3
3
     #
4
4
     # %CopyrightBegin%
5
 
     # 
6
 
     # Copyright Ericsson AB 2009. All Rights Reserved.
7
 
     # 
 
5
     #
 
6
     # Copyright Ericsson AB 2009-2010. All Rights Reserved.
 
7
     #
8
8
     # The contents of this file are subject to the Erlang Public License,
9
9
     # Version 1.1, (the "License"); you may not use this file except in
10
10
     # compliance with the License. You should have received a copy of the
11
11
     # Erlang Public License along with this software. If not, it can be
12
12
     # retrieved online at http://www.erlang.org/.
13
 
     # 
 
13
     #
14
14
     # Software distributed under the License is distributed on an "AS IS"
15
15
     # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
16
16
     # the License for the specific language governing rights and limitations
17
17
     # under the License.
18
 
     # 
 
18
     #
19
19
     # %CopyrightEnd%
20
20
     
21
21
     -->
40
40
        <div id="container">
41
41
          <script id="js" type="text/javascript" language="JavaScript" src="{$topdocdir}/js/flipmenu/flipmenu.js"/>
42
42
          <script id="js2" type="text/javascript" src="{$topdocdir}/js/erlresolvelinks.js"></script>
 
43
          <script language="JavaScript" type="text/javascript">
 
44
            <xsl:text disable-output-escaping="yes"><![CDATA[
 
45
            <!--            
 
46
              function getWinHeight() {
 
47
                var myHeight = 0;
 
48
                if( typeof( window.innerHeight ) == 'number' ) {
 
49
                  //Non-IE
 
50
                  myHeight = window.innerHeight;
 
51
                } else if( document.documentElement && ( document.documentElement.clientWidth || 
 
52
                                                         document.documentElement.clientHeight ) ) {
 
53
                  //IE 6+ in 'standards compliant mode'
 
54
                  myHeight = document.documentElement.clientHeight;
 
55
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
 
56
                  //IE 4 compatible
 
57
                  myHeight = document.body.clientHeight;
 
58
                }
 
59
                return myHeight;            
 
60
              }
 
61
 
 
62
              function setscrollpos() {
 
63
                var objf=document.getElementById('loadscrollpos');
 
64
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
 
65
              }
 
66
 
 
67
              function addEvent(obj, evType, fn){ 
 
68
                if (obj.addEventListener){ 
 
69
                obj.addEventListener(evType, fn, true); 
 
70
                return true; 
 
71
              } else if (obj.attachEvent){ 
 
72
                var r = obj.attachEvent("on"+evType, fn); 
 
73
                return r; 
 
74
              } else { 
 
75
                return false; 
 
76
              } 
 
77
             }
 
78
 
 
79
             addEvent(window, 'load', setscrollpos);
 
80
 
 
81
             //-->]]></xsl:text>
 
82
          </script>
43
83
          <!-- Generate menu -->
44
84
          <xsl:call-template name="menu">
45
85
            <xsl:with-param name="chapnum" select="$chapnum"/>
61
101
                <xsl:value-of select="$copyright"/>
62
102
                <xsl:value-of select="/book/header/copyright/year[1]"/>
63
103
                <xsl:text>-</xsl:text>
64
 
                <xsl:value-of select="substring-after(substring-after($gendate, ' '), ' ')"/>
 
104
                <xsl:value-of select="substring-after(normalize-space(substring-after($gendate, ' ')), ' ')"/>
65
105
                <xsl:text> </xsl:text>
66
106
                <xsl:value-of select="/book/header/copyright/holder"/>
67
107
              </p>
543
583
          <xsl:otherwise>false</xsl:otherwise>
544
584
        </xsl:choose>
545
585
      </xsl:variable>
546
 
      <li title="{header/title}" expanded="{$expanded}">
 
586
      <xsl:variable name="loadscrollpos">
 
587
        <xsl:choose>
 
588
          <xsl:when test="$chapnum = $curchapnum">loadscrollpos</xsl:when>
 
589
          <xsl:otherwise>no</xsl:otherwise>
 
590
        </xsl:choose>
 
591
      </xsl:variable>
 
592
      <li id="{$loadscrollpos}" title="{header/title}" expanded="{$expanded}">
547
593
        <xsl:value-of select="header/title"/>
548
594
        <ul>
549
595
          <li>
656
702
 
657
703
  <!-- Menu.ref -->
658
704
  <xsl:template name="menu.ref">
659
 
    <xsl:param name="$curModule"/>
 
705
    <xsl:param name="curModule"/>
660
706
    <div id="leftnav">
661
707
      <div class="innertube">
662
708
 
731
777
        </xsl:choose>
732
778
      </xsl:variable>
733
779
 
 
780
      <xsl:variable name="loadscrollpos">
 
781
        <xsl:choose>
 
782
          <xsl:when test="$curModule = $cval">loadscrollpos</xsl:when>
 
783
          <xsl:otherwise>no</xsl:otherwise>
 
784
        </xsl:choose>
 
785
      </xsl:variable>
 
786
 
734
787
      <xsl:variable name="link_cval"><xsl:value-of select="translate($cval, '&#173;', '')"/></xsl:variable>
735
788
 
736
789
      <xsl:choose>
737
790
        <xsl:when test="$genFuncMenu = 'true'">
738
791
 
739
 
          <li title="{$cval} " expanded="{$expanded}">
 
792
          <li id="{$loadscrollpos}" title="{$cval} " expanded="{$expanded}">
740
793
            <xsl:value-of select="$cval"/>
741
794
            <ul>
742
795
              <li>
788
841
            <xsl:when test="string-length($fname) > 0">
789
842
              <li title="{$fname}">
790
843
                <a href="{$basename}.html#{$fname}">  
791
 
                <xsl:value-of select="$fname"/>()
792
 
              </a>
793
 
            </li>           
794
 
          </xsl:when>
795
 
          <xsl:otherwise>
796
 
            <li title="{name/nametext}">
797
 
              <a href="{$basename}.html#{name/nametext}">  
798
 
                <xsl:value-of select="nametext"/>()
799
 
              </a> 
800
 
            </li>    
801
 
          </xsl:otherwise>
802
 
        </xsl:choose> 
803
 
      </xsl:when>
804
 
      
805
 
      <xsl:when test="ancestor::erlref">
806
 
 
807
 
        <xsl:variable name="tmpstring">
808
 
          <xsl:value-of select="substring-before(substring-after(., '('), '->')"/>
809
 
        </xsl:variable>     
810
 
 
811
 
        <xsl:variable name="ustring">
812
 
          <xsl:choose>
813
 
            <xsl:when test="string-length($tmpstring) > 0">
814
 
              <xsl:call-template name="remove-paren">
815
 
                <xsl:with-param name="string" select="$tmpstring"/>
816
 
              </xsl:call-template>            
 
844
                  <xsl:value-of select="$fname"/>()
 
845
                </a>
 
846
              </li>           
817
847
            </xsl:when>
818
848
            <xsl:otherwise>
819
 
              <xsl:call-template name="remove-paren">
820
 
                <xsl:with-param name="string" select="substring-after(., '(')"/>
821
 
              </xsl:call-template>                      
 
849
              <li title="{name/nametext}">
 
850
                <a href="{$basename}.html#{name/nametext}">  
 
851
                  <xsl:value-of select="nametext"/>()
 
852
                </a> 
 
853
              </li>    
822
854
            </xsl:otherwise>
823
 
          </xsl:choose>
824
 
        </xsl:variable>      
825
 
 
826
 
        <xsl:variable name="arity">
827
 
          <xsl:call-template name="calc-arity">
828
 
            <xsl:with-param name="string" select="substring-before($ustring, ')')"/>
829
 
            <xsl:with-param name="no-of-pars" select="0"/> 
830
 
          </xsl:call-template>
831
 
        </xsl:variable> 
832
 
        <xsl:variable name="fname">
833
 
          <xsl:value-of select="substring-before(., '(')"/>
834
 
        </xsl:variable>
835
 
        <li title="{$fname}-{$arity}">
836
 
          <a href="{$basename}.html#{$fname}-{$arity}">                                             
837
 
            <xsl:value-of select="$fname"/>/<xsl:value-of select="$arity"/>
838
 
          </a>
839
 
        </li>        
840
 
      </xsl:when>
841
 
    </xsl:choose>
842
 
 
 
855
          </xsl:choose> 
 
856
        </xsl:when>
 
857
        
 
858
        <xsl:when test="ancestor::erlref">
 
859
          
 
860
          <xsl:variable name="tmpstring">
 
861
            <xsl:value-of select="substring-before(substring-after(., '('), '->')"/>
 
862
          </xsl:variable>     
 
863
            
 
864
          <xsl:variable name="ustring">
 
865
            <xsl:choose>
 
866
              <xsl:when test="string-length($tmpstring) > 0">
 
867
                <xsl:call-template name="remove-paren">
 
868
                  <xsl:with-param name="string" select="$tmpstring"/>
 
869
                </xsl:call-template>            
 
870
              </xsl:when>
 
871
              <xsl:otherwise>
 
872
                <xsl:call-template name="remove-paren">
 
873
                  <xsl:with-param name="string" select="substring-after(., '(')"/>
 
874
                </xsl:call-template>                      
 
875
              </xsl:otherwise>
 
876
            </xsl:choose>
 
877
          </xsl:variable>      
 
878
          
 
879
          <xsl:variable name="arity">
 
880
            <xsl:call-template name="calc-arity">
 
881
              <xsl:with-param name="string" select="substring-before($ustring, ')')"/>
 
882
              <xsl:with-param name="no-of-pars" select="0"/> 
 
883
            </xsl:call-template>
 
884
          </xsl:variable> 
 
885
          
 
886
          <xsl:variable name="fname">
 
887
            <xsl:variable name="fname1">
 
888
              <xsl:value-of select="substring-before(., '(')"/>
 
889
            </xsl:variable>
 
890
            <xsl:variable name="fname2">
 
891
              <xsl:value-of select="substring-after($fname1, 'erlang:')"/>
 
892
            </xsl:variable>
 
893
            <xsl:choose>
 
894
              <xsl:when test="string-length($fname2) > 0">   
 
895
                <xsl:value-of select="$fname2"/>
 
896
              </xsl:when>
 
897
              <xsl:otherwise>
 
898
                <xsl:value-of select="$fname1"/>
 
899
              </xsl:otherwise>
 
900
            </xsl:choose>
 
901
          </xsl:variable>
 
902
            
 
903
          <li title="{$fname}-{$arity}">
 
904
            <a href="{$basename}.html#{$fname}-{$arity}">                                             
 
905
              <xsl:value-of select="$fname"/>/<xsl:value-of select="$arity"/>
 
906
            </a>
 
907
          </li>      
 
908
        </xsl:when>
 
909
      </xsl:choose>
 
910
      
843
911
    </xsl:for-each>
844
912
  </xsl:template>
845
913
 
1065
1133
 
1066
1134
  <!-- Funcs -->
1067
1135
  <xsl:template match="funcs">
 
1136
    <xsl:param name="partnum"/>
1068
1137
 
1069
1138
    <h3>
1070
1139
      <xsl:text>EXPORTS</xsl:text>
1121
1190
        <a name="{substring-before(nametext, '(')}"><span class="bold_code"><xsl:value-of select="ret"/><xsl:text> </xsl:text><xsl:value-of select="nametext"/></span></a><br/>
1122
1191
      </xsl:when>
1123
1192
      <xsl:when test="ancestor::erlref">
1124
 
        <a name="{substring-before(., '(')}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
 
1193
        <xsl:variable name="fname">
 
1194
          <xsl:variable name="fname1">
 
1195
            <xsl:value-of select="substring-before(., '(')"/>
 
1196
          </xsl:variable>
 
1197
          <xsl:variable name="fname2">
 
1198
            <xsl:value-of select="substring-after($fname1, 'erlang:')"/>
 
1199
          </xsl:variable>
 
1200
          <xsl:choose>
 
1201
            <xsl:when test="string-length($fname2) > 0">   
 
1202
              <xsl:value-of select="$fname2"/>
 
1203
            </xsl:when>
 
1204
            <xsl:otherwise>
 
1205
              <xsl:value-of select="$fname1"/>
 
1206
            </xsl:otherwise>
 
1207
          </xsl:choose>
 
1208
        </xsl:variable>
 
1209
        <a name="{$fname}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
1125
1210
      </xsl:when>
1126
1211
    </xsl:choose>
1127
1212
      
1128
 
 
1129
1213
  </xsl:template>
1130
1214
 
1131
1215
 
1167
1251
 
1168
1252
  <!-- Desc -->
1169
1253
  <xsl:template match="desc">
 
1254
    <xsl:param name="partnum"/>
1170
1255
    <div class="REFBODY">
1171
1256
      <p>
1172
1257
        <xsl:apply-templates>
1458
1543
    </xsl:choose>
1459
1544
  </xsl:template>
1460
1545
 
 
1546
 
1461
1547
  <xsl:template name="remove-paren">
1462
1548
    <xsl:param name="string"/>
 
1549
 
 
1550
    <xsl:variable name="str1">
 
1551
      <xsl:call-template name="remove-paren-1">
 
1552
        <xsl:with-param name="string" select="$string"/>
 
1553
        <xsl:with-param name="start">(</xsl:with-param> 
 
1554
        <xsl:with-param name="end">)</xsl:with-param> 
 
1555
      </xsl:call-template>    
 
1556
    </xsl:variable>
 
1557
 
 
1558
    <xsl:variable name="str2">
 
1559
      <xsl:call-template name="remove-paren-1">
 
1560
        <xsl:with-param name="string" select="$str1"/>
 
1561
        <xsl:with-param name="start">{</xsl:with-param>
 
1562
        <xsl:with-param name="end">}</xsl:with-param>
 
1563
      </xsl:call-template>    
 
1564
    </xsl:variable>
 
1565
 
 
1566
    <xsl:variable name="str3">
 
1567
      <xsl:call-template name="remove-paren-1">
 
1568
        <xsl:with-param name="string" select="$str2"/>
 
1569
        <xsl:with-param name="start">[</xsl:with-param>
 
1570
        <xsl:with-param name="end">]</xsl:with-param>
 
1571
      </xsl:call-template>    
 
1572
    </xsl:variable>
 
1573
 
 
1574
    <xsl:value-of select="$str3"/>
 
1575
 
 
1576
  </xsl:template>
 
1577
 
 
1578
 
 
1579
  <xsl:template name="remove-paren-1">
 
1580
    <xsl:param name="string"/>
 
1581
    <xsl:param name="start"/>
 
1582
    <xsl:param name="end"/>
1463
1583
   
1464
 
    <xsl:variable name="bstring">
1465
 
      <xsl:value-of select="substring-before($string, '(')"/>
 
1584
    <xsl:variable name="tmp1">
 
1585
      <xsl:value-of select="substring-before($string, $start)"/>
1466
1586
    </xsl:variable>
1467
1587
 
1468
1588
    <xsl:choose>
1469
 
      <xsl:when test="string-length($bstring) > 0">
1470
 
        <xsl:variable name="astring">
1471
 
          <xsl:value-of select="substring-after($string, ')')"/>
 
1589
      <xsl:when test="string-length($tmp1) > 0 or starts-with($string, $start)">
 
1590
        <xsl:variable name="tmp2">
 
1591
          <xsl:value-of select="substring-after($string, $end)"/>
1472
1592
        </xsl:variable>
1473
1593
        <xsl:variable name="retstring">
1474
1594
          <xsl:call-template name="remove-paren">
1475
 
            <xsl:with-param name="string" select="$astring"/>
 
1595
            <xsl:with-param name="string" select="$tmp2"/>
1476
1596
          </xsl:call-template>        
1477
1597
        </xsl:variable>
1478
 
        <xsl:value-of select="concat($bstring, $retstring)"/>
 
1598
        <xsl:value-of select="concat(concat($tmp1, 'x'), $retstring)"/>
1479
1599
      </xsl:when>
1480
1600
      <xsl:otherwise>
1481
1601
        <xsl:value-of select="$string"/>
1482
1602
      </xsl:otherwise>
1483
1603
    </xsl:choose>
 
1604
 
1484
1605
  </xsl:template>
1485
1606
 
1486
1607
</xsl:stylesheet>