[yelp-xsl] [theme-html] Synopsis framing should not be around title/desc



commit 233503ebbdaf77377af059ec7f6ffbc8611a3072
Author: Shaun McCance <shaunm gnome org>
Date:   Wed Mar 3 13:27:56 2010 -0600

    [theme-html] Synopsis framing should not be around title/desc
    
    This happened because the output models for synopses is different in
    the Mallard and DocBook transforms.  So I put the framing on the outer
    synopsis div, but that's wrong for Mallard.  The CSS selectors just
    have to match Mallard and DocBook differently.

 xslt/mallard/html/mal2html-block.xsl |   62 ++++++++++++++++++++-------------
 xslt/theme/theme-html.xsl            |    3 +-
 2 files changed, 38 insertions(+), 27 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 2296f77..cf09eea 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -90,12 +90,14 @@ FIXME
   <xsl:if test="$mal2html.editor_mode
                 or processing-instruction('mal2html.show_comment')">
     <div class="comment">
-      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-      <xsl:apply-templates mode="mal2html.block.mode" select="mal:cite"/>
-      <div class="comment-inner">
-        <xsl:for-each select="*[not(self::mal:title or self::mal:cite)]">
-          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
-        </xsl:for-each>
+      <div class="inner">
+        <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+        <xsl:apply-templates mode="mal2html.block.mode" select="mal:cite"/>
+        <div class="contents">
+          <xsl:for-each select="*[not(self::mal:title or self::mal:cite)]">
+            <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+          </xsl:for-each>
+        </div>
       </div>
     </div>
   </xsl:if>
@@ -148,12 +150,14 @@ FIXME
 <!-- = listing = -->
 <xsl:template mode="mal2html.block.mode" match="mal:listing">
   <div class="listing">
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
-    <div class="listing-inner">
-      <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
-        <xsl:apply-templates mode="mal2html.block.mode" select="."/>
-      </xsl:for-each>
+    <div class="inner">
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
+      <div class="contents">
+        <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+        </xsl:for-each>
+      </div>
     </div>
   </div>
 </xsl:template>
@@ -210,7 +214,7 @@ FIXME
   <div class="quote">
     <div class="inner">
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-      <blockquote class="quote-inner">
+      <blockquote class="contents">
         <xsl:for-each select="*[not(self::mal:title or self::mal:cite)]">
           <xsl:apply-templates mode="mal2html.block.mode" select="."/>
         </xsl:for-each>
@@ -250,12 +254,14 @@ FIXME
 <!-- = synopsis = -->
 <xsl:template mode="mal2html.block.mode" match="mal:synopsis">
   <div class="synopsis">
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
-    <div class="synopsis-inner">
-      <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
-        <xsl:apply-templates mode="mal2html.block.mode" select="."/>
-      </xsl:for-each>
+    <div class="inner">
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
+      <div class="contents">
+        <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+        </xsl:for-each>
+      </div>
     </div>
   </div>
 </xsl:template>
@@ -267,13 +273,19 @@ FIXME
   </div>
 </xsl:template>
 
-<!-- FIXME -->
+<xsl:template mode="mal2html.block.mode" match="text()"/>
+
 <xsl:template mode="mal2html.block.mode" match="*">
-  <xsl:message>
-    <xsl:text>Unmatched block element: </xsl:text>
-    <xsl:value-of select="local-name(.)"/>
-  </xsl:message>
-  <xsl:apply-templates mode="mal2html.inline.mode"/>
+  <xsl:param name="restricted" select="false()"/>
+  <xsl:if test="not($restricted)">
+    <xsl:message>
+      <xsl:text>Unmatched block element: </xsl:text>
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:message>
+    <xsl:apply-templates mode="mal2html.block.mode">
+      <xsl:with-param name="restricted" select="true()"/>
+    </xsl:apply-templates>
+  </xsl:if>
 </xsl:template>
 
 </xsl:stylesheet>
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
index 67d5e2b..bf55d9e 100644
--- a/xslt/theme/theme-html.xsl
+++ b/xslt/theme/theme-html.xsl
@@ -335,7 +335,7 @@ ol.steps .steps {
 }
 li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
 li.steps li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em; }
-div.synopsis {
+div.synopsis > div.inner > div.contents, div.synopsis > pre.contents {
   padding: 0.5em 1em 0.5em 1em;
   border-top: solid 1px;
   border-bottom: solid 1px;
@@ -344,7 +344,6 @@ div.synopsis {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
 }
-div.synopsis > pre.contents { margin: 0; padding: 0; }
 div.synopsis > div.inner > div.desc { font-style: italic; }
 div.synopsis div.code {
   background: none;



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