Author: jonpryor
Date: 2008-02-08 13:11:21 -0500 (Fri, 08 Feb 2008)
New Revision: 95289

Modified:
   trunk/monodoc/tools/ChangeLog
   trunk/monodoc/tools/DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html
   trunk/monodoc/tools/stylesheet.xsl
Log:
        * stylesheet.xsl: Allow use of both <see cref="GenericType{A}" /> and 
          <see cref="GenericType&lt;A&gt;" /> to be consistent wrt each other.
          - Canonicalize generic types within link targets so that {} is used, 
as 
            1. this is what the */@id code generates, so such links will 
actually 
               work (as opposed to <>-using links, which will fail), and 
            2. the {} links are shorter and easier to read due to less markup.
          - Canonicalize generic types within link text to use <>, so e.g. 
            <see cref="System.Action{`0}" /> is displayed as System.Action<`0>.
            This also allows output to be consistent, no matter what the 
see/@cref
            text uses.
          - When creating links to go-mono.com, ensure that generic type names 
are 
            of the form Type`N, not Type{...}, as go-mono.com doesn't generate 
            useful output for the latter form of URL.
        * DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html: Flush.


Modified: trunk/monodoc/tools/ChangeLog
===================================================================
--- trunk/monodoc/tools/ChangeLog       2008-02-08 18:09:35 UTC (rev 95288)
+++ trunk/monodoc/tools/ChangeLog       2008-02-08 18:11:21 UTC (rev 95289)
@@ -1,3 +1,20 @@
+2008-01-08  Jonathan Pryor <[EMAIL PROTECTED]>
+
+       * stylesheet.xsl: Allow use of both <see cref="GenericType{A}" /> and 
+         <see cref="GenericType&lt;A&gt;" /> to be consistent wrt each other.
+         - Canonicalize generic types within link targets so that {} is used, 
as 
+           1. this is what the */@id code generates, so such links will 
actually 
+              work (as opposed to <>-using links, which will fail), and 
+           2. the {} links are shorter and easier to read due to less markup.
+         - Canonicalize generic types within link text to use <>, so e.g. 
+           <see cref="System.Action{`0}" /> is displayed as System.Action<`0>.
+           This also allows output to be consistent, no matter what the 
see/@cref
+           text uses.
+         - When creating links to go-mono.com, ensure that generic type names 
are 
+           of the form Type`N, not Type{...}, as go-mono.com doesn't generate 
+           useful output for the latter form of URL.
+       * DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html: Flush.
+
 2008-01-06  Jonathan Pryor <[EMAIL PROTECTED]>
 
        * monodocer.cs: Yet another "if you remove a node while traversing its

Modified: 
trunk/monodoc/tools/DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html
===================================================================
--- 
trunk/monodoc/tools/DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html    
    2008-02-08 18:09:35 UTC (rev 95288)
+++ 
trunk/monodoc/tools/DocTest/html.expected/Mono.DocTest.Generic/MyList`2.html    
    2008-02-08 18:11:21 UTC (rev 95289)
@@ -439,7 +439,7 @@
         <div class="MemberBox">
           <p>To be added.</p>
           <h4 class="Subsection">Returns</h4>
-          <div class="SubsectionBox">A <a 
href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.List{`0}.Enumerator";>System.Collections.Generic.List{`0}.Enumerator</a>.</div>
+          <div class="SubsectionBox">A <a 
href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Collections.Generic.List`1.Enumerator";>System.Collections.Generic.List&lt;`0&gt;.Enumerator</a>.</div>
           <h4 class="Subsection">Remarks</h4>
           <div class="SubsectionBox">
             <tt>

Modified: trunk/monodoc/tools/stylesheet.xsl
===================================================================
--- trunk/monodoc/tools/stylesheet.xsl  2008-02-08 18:09:35 UTC (rev 95288)
+++ trunk/monodoc/tools/stylesheet.xsl  2008-02-08 18:11:21 UTC (rev 95289)
@@ -774,7 +774,11 @@
                <xsl:otherwise>
                        <xsl:variable name="escaped-type">
                                <xsl:call-template name="GetEscapedTypeName">
-                                       <xsl:with-param name="typename" 
select="$type" />
+                                       <xsl:with-param name="typename">
+                                               <xsl:call-template 
name="ToBrackets">
+                                                       <xsl:with-param 
name="s" select="$type" />
+                                               </xsl:call-template>
+                                       </xsl:with-param>
                                </xsl:call-template>
                        </xsl:variable>
                        <xsl:variable name="T" select="$type"/>
@@ -842,11 +846,23 @@
                                        </xsl:when>
 
                                        <xsl:otherwise>
-                                               <xsl:value-of select="translate 
($T, '+', '.')"/>
+                                               <xsl:call-template 
name="ToBrackets">
+                                                       <xsl:with-param 
name="s" select="translate ($T, '+', '.')" />
+                                               </xsl:call-template>
                                        </xsl:otherwise>
                                </xsl:choose>
        </xsl:template>
 
+       <xsl:template name="ToBrackets">
+               <xsl:param name="s" />
+               <xsl:value-of select="translate (translate ($s, '{', '&lt;'), 
'}', '&gt;')" />
+       </xsl:template>
+
+       <xsl:template name="ToBraces">
+               <xsl:param name="s" />
+               <xsl:value-of select="translate (translate ($s, '&lt;', '{'), 
'&gt;', '}')" />
+       </xsl:template>
+
        <xsl:template name="GetLinkTarget">
                <xsl:param name="type" />
                <xsl:param name="local-suffix" />
@@ -936,7 +952,12 @@
                        <xsl:attribute name="href">
                                <xsl:call-template name="GetLinkTarget">
                                        <xsl:with-param name="type" 
select="$escaped-type" />
-                                       <xsl:with-param 
name="local-suffix">#<xsl:value-of select="$cref" /></xsl:with-param>
+                                       <xsl:with-param name="local-suffix">
+                                               <xsl:text>#</xsl:text>
+                                               <xsl:call-template 
name="ToBraces">
+                                                       <xsl:with-param 
name="s" select="$cref" />
+                                               </xsl:call-template>
+                                       </xsl:with-param>
                                        <xsl:with-param name="remote">
                                                <xsl:value-of 
select="$mono-docs" />
                                                <xsl:value-of select="$cref" />

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to