You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2006/04/19 21:06:02 UTC

svn commit: r395353 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft

Author: thorsten
Date: Wed Apr 19 12:06:00 2006
New Revision: 395353

URL: http://svn.apache.org/viewcvs?rev=395353&view=rev
Log:
Adding content-css link that allows abitrary styles to be passed through. This is a nice to have contract (should not be used in official forrest structurer) and I added a use-at-your-own-risk warning and the note from Ross explaining the warning. Not tested yet.

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft
      - copied, changed from r394787, forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/blank.ft

Copied: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft (from r394787, forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/blank.ft)
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft?p2=forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft&p1=forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/blank.ft&r1=394787&r2=395353&rev=395353&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/blank.ft (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-css.ft Wed Apr 19 12:06:00 2006
@@ -18,26 +18,36 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  name="blank">
-  
-  <!--NOTE: 
-    When using the blank template as c'n p master just search and replace 'blank' by the {contract-name}!-->
+  name="content-css">
   
   <description>
-    blank will output {contract-funtion}. This is just a blank contract, it will output *nothing*.
+    <warning>Use at your own risk!!!</warning>
+    <note>
+      Allowing and activating abitrary styles has its danger. The problem is that Forrest 
+attempts to provide a unified output formats regardless of the input 
+format. If you use this contract and allow arbitrary styles through then forrest loose the ability 
+to do this because user can create "headings" by making text larger and 
+bold, for example. Forrest has no way of knowing this is supposed to be 
+a heading and therefore cannot render it as such.
+    </note>
+    <p>This contract picks up the style element of the input and pass it through to the output.</p>
   </description>
-  <usage><![CDATA[<forrest:contract name="blank"/>]]></usage>
+  <usage><![CDATA[<forrest:contract name="content-css"/>]]></usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
-    name="blank" inputFormat="xsl">
+    name="content-css" inputFormat="xsl">
     <xsl:stylesheet version="1.1" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-      <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
-      <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->
       <xsl:template match="/">
         <forrest:content>
-          <!--<forrest:part/>-->
-          <!--<forrest:part xpath="/html/head"/>-->
+          <forrest:part xpath="/html/head">
+            <xsl:apply-templates select="//style"/>
+          </forrest:part>
         </forrest:content>
+      </xsl:template>
+      <xsl:template match="style">
+        <style type="text/css">
+          <xsl:value-of select="."/>
+        </style>
       </xsl:template>
     </xsl:stylesheet>
   </forrest:template>