[yelp-xsl] mal2html: 'heading' style hint on links and title



commit cc346d5ab6e848207744dad88361d17c4ae8dcae
Author: Shaun McCance <shaunm gnome org>
Date:   Sun Mar 3 23:31:51 2013 -0500

    mal2html: 'heading' style hint on links and title
    
    For the designs for the new index and getting-started

 xslt/mallard/html/mal2html-block.xsl |    9 ++++-
 xslt/mallard/html/mal2html-links.xsl |   70 ++++++++++++++++++++++++++++++++++
 xslt/mallard/html/mal2html-page.xsl  |    9 ++++
 3 files changed, 87 insertions(+), 1 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 1241227..5a39f78 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -560,7 +560,14 @@ in accordance with the Mallard specification on fallback block content.
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
-  <div class="title title-{local-name(..)}">
+  <div>
+    <xsl:attribute name="class">
+      <xsl:text>title title-</xsl:text>
+      <xsl:value-of select="local-name(..)"/>
+      <xsl:if test="contains(concat(' ', @style, ' '), ' heading ')">
+        <xsl:text> title-heading</xsl:text>
+      </xsl:if>
+    </xsl:attribute>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:element name="{concat('h', $depth_)}" namespace="{$html.namespace}">
       <span class="title">
diff --git a/xslt/mallard/html/mal2html-links.xsl b/xslt/mallard/html/mal2html-links.xsl
index 3ab6d65..f691657 100644
--- a/xslt/mallard/html/mal2html-links.xsl
+++ b/xslt/mallard/html/mal2html-links.xsl
@@ -176,6 +176,14 @@ parameter will be used if provided.
               <xsl:with-param name="nodesc" select="$nodesc"/>
             </xsl:call-template>
           </xsl:when>
+          <xsl:when test="contains($style, ' heading ')">
+            <xsl:call-template name="_mal2html.links.heading">
+              <xsl:with-param name="node" select="$node"/>
+              <xsl:with-param name="links" select="$links"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="nodesc" select="$nodesc"/>
+            </xsl:call-template>
+          </xsl:when>
           <xsl:when test="contains($style, ' 2column ')">
             <xsl:variable name="coltot" select="ceiling(count($links) div 2)"/>
             <div class="links-twocolumn">
@@ -802,6 +810,7 @@ when determining which links to output.
 </xsl:template>
 
 
+<!--#* _mal2html.links.mouseovers -->
 <xsl:template name="_mal2html.links.mouseovers">
   <xsl:param name="node"/>
   <xsl:param name="links"/>
@@ -849,6 +858,8 @@ when determining which links to output.
   <div class="clear"/>
 </xsl:template>
 
+
+<!--#* _mal2html.links.grid -->
 <xsl:template name="_mal2html.links.grid">
   <xsl:param name="node"/>
   <xsl:param name="links"/>
@@ -895,6 +906,8 @@ when determining which links to output.
   </xsl:for-each>
 </xsl:template>
 
+
+<!--#* _mal2html.links.divs -->
 <xsl:template name="_mal2html.links.divs">
   <xsl:param name="node"/>
   <xsl:param name="links"/>
@@ -973,4 +986,61 @@ when determining which links to output.
   <xsl:apply-templates mode="_mal2html.links.divs.nolink.mode" select="node()"/>
 </xsl:template>
 
+
+<!--#* _mal2html.links.heading -->
+<xsl:template name="_mal2html.links.heading">
+  <xsl:param name="node" select="$node"/>
+  <xsl:param name="links" select="$links"/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="nodesc" select="false()"/>
+  <ul class="links-heading">
+    <xsl:for-each select="$links">
+      <xsl:sort data-type="number" select="@groupsort"/>
+      <xsl:sort select="mal:title[ type = 'sort']"/>
+      <xsl:variable name="link" select="."/>
+      <xsl:variable name="xref" select="@xref"/>
+      <xsl:for-each select="$mal.cache">
+        <xsl:variable name="target" select="key('mal.cache.key', $xref)"/>
+        <li class="links {$link/@class}">
+          <xsl:for-each select="$link/@*">
+            <xsl:if test="starts-with(name(.), 'data-')">
+              <xsl:copy-of select="."/>
+            </xsl:if>
+          </xsl:for-each>
+          <div class="links-heading">
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="mal.link.target">
+                  <xsl:with-param name="xref" select="$xref"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:attribute name="title">
+                <xsl:call-template name="mal.link.tooltip">
+                  <xsl:with-param name="xref" select="$xref"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:call-template name="mal.link.content">
+                <xsl:with-param name="node" select="."/>
+                <xsl:with-param name="xref" select="$xref"/>
+                <xsl:with-param name="role" select="$role"/>
+              </xsl:call-template>
+            </a>
+            <xsl:call-template name="mal2html.editor.badge">
+              <xsl:with-param name="target" select="$target"/>
+            </xsl:call-template>
+          </div>
+          <xsl:if test="not($nodesc)">
+            <xsl:variable name="desc" select="$target/mal:info/mal:desc"/>
+            <xsl:if test="$desc">
+              <div class="desc">
+                <xsl:apply-templates mode="mal2html.inline.mode" select="$desc/node()"/>
+              </div>
+            </xsl:if>
+          </xsl:if>
+        </li>
+      </xsl:for-each>
+    </xsl:for-each>
+  </ul>
+</xsl:template>
+
 </xsl:stylesheet>
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index ed30c61..f8d5704 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -940,6 +940,15 @@ div.floatend {
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
 }
 
+div.title-heading h1, div.title-heading h2, div.title-heading h3,
+div.title-heading h4, div.title-heading h5, div.title-heading h6 {
+  font-size: 1.72em;
+  font-weight: bold;
+}
+ul.links-heading > li { margin: 2em 0 2em 0; padding: 0; }
+div.links-heading > a { font-size: 1.72em; font-weight: bold; }
+ul.links-heading > li > div.desc { margin-top: 0.5em; }
+
 div.mouseovers {
   width: 250px;
   height: 200px;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]