[monodoc] Backport XSL changes that were made after branching
authorJeremie Laval <jeremie.laval@gmail.com>
Mon, 28 Jan 2013 11:43:03 +0000 (11:43 +0000)
committerJeremie Laval <jeremie.laval@gmail.com>
Mon, 28 Jan 2013 11:51:25 +0000 (11:51 +0000)
mcs/class/monodoc/Resources/mdoc-html-utils.xsl
mcs/class/monodoc/Resources/mdoc-sections-css.xsl
mcs/class/monodoc/Resources/mdoc-sections.xsl

index 4403d0983fc86bec367e102ad687284aec974d33..c8a84a84634bc15ed1c6b75661af05d95a4e6f22 100644 (file)
        </xsl:template>
 
        <xsl:template name="CreateTypeSignature">
-                       <xsl:attribute name="id">
-                               <xsl:text>T:</xsl:text>
-                               <xsl:call-template name="GetEscapedTypeName">
-                                       <xsl:with-param name="typename" select="@FullName" />
-                               </xsl:call-template>
-                               <xsl:text>:Signature</xsl:text>
-                       </xsl:attribute>
-                       <!-- signature -->
                        <xsl:call-template name="CreateSignature">
+                           <xsl:with-param name="id">
+                                 <xsl:text>T:</xsl:text>
+                                 <xsl:call-template name="GetEscapedTypeName">
+                                       <xsl:with-param name="typename" select="@FullName" />
+                                 </xsl:call-template>
+                                 <xsl:text>:Signature</xsl:text>
+                               </xsl:with-param>
                                <xsl:with-param name="content">
+                       <!-- signature -->
                                        <xsl:choose>
                                        <xsl:when test="$language='C#'">
 
                <h3 class="{$type}"><xsl:value-of select="$section" /></h3>
                <ul class="{$type}">
                  <xsl:for-each select="Docs/related[@type=$type]">
-                       <li><a href="{@href}"><xsl:value-of select="." /></a></li>
+                       <li><a href="{@href}" target="_blank"><xsl:value-of select="." /></a></li>
                  </xsl:for-each>
                </ul>
          </xsl:if>
                                  <xsl:with-param name="type" select="'article'" />
                                </xsl:call-template>
                                <xsl:call-template name="CreateRelatedSection">
-                                 <xsl:with-param name="section" select="'Available Samples'" />
+                                 <xsl:with-param name="section" select="'Recipes'" />
+                                 <xsl:with-param name="type" select="'recipe'" />
+                               </xsl:call-template>
+                               <xsl:call-template name="CreateRelatedSection">
+                                 <xsl:with-param name="section" select="'Samples'" />
                                  <xsl:with-param name="type" select="'sample'" />
                                </xsl:call-template>
                                <xsl:call-template name="CreateRelatedSection">
        </xsl:template>
        <xsl:template match="img">
          <p>
-               <img src="source-id:{$source-id}:{@href}">
+               <img>
+                 <xsl:attribute name="src">
+                       <!-- we recognize two types of images:
+                                  - those with src attribute that reference directly an external image
+                                  - those with a href attributes which are internally available as part of the doc bundle
+                       -->
+                       <xsl:choose>
+                         <xsl:when test="count(@src)&gt;0">
+                               <xsl:value-of select="@src" />
+                         </xsl:when>
+                         <xsl:when test="count(@href)&gt;0">
+                               <xsl:value-of select="concat('source-id:', $source-id, ':', @href)" />
+                         </xsl:when>
+                       </xsl:choose>
+                 </xsl:attribute>
                  <xsl:attribute name="class">
                        <xsl:choose>
                          <xsl:when test="count(@class)&gt;0">
@@ -2533,7 +2551,7 @@ SkipGenericArgument: invalid type substring '<xsl:value-of select="$s" />'
                        <xsl:with-param name="type" select="$type" />
                        <xsl:with-param name="member" select="$member" />
                </xsl:call-template>
-               <xsl:if test="count($member/Parameters/Parameter) &gt; 0">
+               <xsl:if test="count($member/Parameters/Parameter) &gt; 0 or $member/MemberType='Method' or $member/MemberType='Constructor'">
                        <xsl:text>(</xsl:text>
                        <xsl:for-each select="Parameters/Parameter">
                                <xsl:if test="not(position()=1)">,</xsl:if>
index ab310431088658a1916d0c9d099c5166b20cd0c2..11772ee344b7784d70a2b8f181c0a7d900c23da1 100644 (file)
 
        <xsl:template name="CreateSignature">
                <xsl:param name="content" />
+               <xsl:param name="id" />
                <h2>Syntax</h2>
                <div class="Signature">
+                       <xsl:attribute name="id">
+                         <xsl:copy-of select="$id" />
+                       </xsl:attribute>
                        <xsl:copy-of select="$content" />
                </div>
        </xsl:template>
index 03d8383cf2b18e2a8e3fc99311fcb9393c66b766..894faeaf9ee5768a26e5a457bf191ec142394ce5 100644 (file)
 
        <xsl:template name="CreateSignature">
                <xsl:param name="content" />
+               <xsl:param name="id" />
                <table class="SignatureTable" bgcolor="#c0c0c0" cellspacing="0" width="100%">
+                 <xsl:attribute name="id">
+                       <xsl:copy-of select="$id" />
+                 </xsl:attribute>
                <tr><td>
                        <table class="InnerSignatureTable" cellpadding="10" cellspacing="0" width="100%">
                        <tr bgcolor="#f2f2f2">