cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/skins/printer/stylesheets book2project.xsl changes2document.xsl copyover.xsl directory2project.xsl document2html.xsl document2project.xsl faqs2document.xsl scan4resources.xsl spec2html.xsl todo2document.xsl
Date Mon, 22 May 2000 13:47:33 GMT
stefano     00/05/22 06:47:33

  Added:       skins/printer loader.xml
               skins/printer/resources simple.css
               skins/printer/stylesheets book2project.xsl
                        changes2document.xsl copyover.xsl
                        directory2project.xsl document2html.xsl
                        document2project.xsl faqs2document.xsl
                        scan4resources.xsl spec2html.xsl todo2document.xsl
  Log:
  added printer-friendly skin for out documentation (not yet polished, but works)
  
  Revision  Changes    Path
  1.1                  xml-cocoon/skins/printer/loader.xml
  
  Index: loader.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- CVS $Revision: 1.1 $ $Date: 2000/05/22 13:47:31 $ -->
  
  <loader>
    <processor name="xslt">
      <parameter name="stylesheet" value="sbk:/style/stylesheets/book2project.xsl"/>
    </processor>
  </loader>
  
  
  
  1.1                  xml-cocoon/skins/printer/resources/simple.css
  
  Index: simple.css
  ===================================================================
  body {
  	background: white fixed no-repeat left top; 
  	color: black; 
  	font-family: sans-serif; 
  	margin: 2em 1em 2em 1em;
  }
  
  h1 {
  	text-align: left;
  	color: #005a9c;
  	font: 170% sans-serif;
  }
  
  h2 {
  	text-align: left;
  	color: #005a9c;
  	font: 140% sans-serif;
  }
  
  h3 {
  	text-align: left;
  	color: #005a9c;
  	font: 120% sans-serif;
  }
  
  h4 {
  	text-align: left;
  	color: #005a9c;
  	font: bold 100% sans-serif;
  }
  
  #main-panel {}
  #side-bar {}
  #content-panel {}
  
  #s1
  #s2
  #s3
  #s4
  
  p {
          padding: 10px 10px 10px 10px;
          margin: 10px 20px 10px 20px;
          text-align: justify;
  }
  
  p.note {
          font-style: italic;
  }
  
  p.source {
  	font-family: monospace;
  }
  
  a:link { color: #005a9c }
  a:visited { color: #a00000 }
  a:active { color: #00a000 }
  a:hover { background: #ffa }
  
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/book2project.xsl
  
  Index: book2project.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- match the root book element -->
    <xsl:template match="book">
      <project>
  
        <parameter name="copyright" value="{@copyright}"/>
        <parameter name="name" value="{@software}"/>
  
        <!-- copy all resources to the targets -->
        <process source="sbk:/style/resources/" producer="directory">
          <processor name="xslt">
            <parameter name="stylesheet" value="sbk:/style/stylesheets/directory2project.xsl"/>
            <parameter name="base" value="resources/"/>
          </processor>
        </process>
  
        <xsl:apply-templates/>
  
      </project>
    </xsl:template>
  
    <xsl:template match="page|hidden">
      <process source="{@source}" producer="parser">
        <processor name="xslt">
          <parameter name="stylesheet" value="sbk:/style/stylesheets/scan4resources.xsl"/>
        </processor>
      </process>
  
      <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
        <processor name="xslt">
          <parameter name="id" value="{@id}"/>
          <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
        </processor>
      </create>
    </xsl:template>
  
    <xsl:template match="spec">
      <process source="{@source}" producer="parser">
        <processor name="xslt">
          <parameter name="stylesheet" value="sbk:/style/stylesheets/scan4resources.xsl"/>
        </processor>
      </process>
  
      <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
        <processor name="xslt">
          <parameter name="id" value="{@id}"/>
          <parameter name="stylesheet" value="sbk:/style/stylesheets/spec2html.xsl"/>
        </processor>
      </create>
    </xsl:template>
    
    <xsl:template match="changes|faqs|todo">
      <process source="{@source}" producer="parser">
        <processor name="xslt">
          <parameter name="stylesheet" value="sbk:/style/stylesheets/{name(.)}2document.xsl"/>
        </processor>
        <processor name="xslt">
          <parameter name="stylesheet" value="sbk:/style/stylesheets/scan4resources.xsl"/>
        </processor>
      </process>
  
      <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
        <processor name="xslt">
          <parameter name="stylesheet" value="sbk:/style/stylesheets/{name(.)}2document.xsl"/>
        </processor>
        <processor name="xslt">
          <parameter name="id" value="{@id}"/>
          <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
        </processor>
      </create>
    </xsl:template>
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/changes2document.xsl
  
  Index: changes2document.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <xsl:import href="copyover.xsl"/>
  
   <xsl:param name="name"/>
  
   <xsl:template match="changes">
    <document>
     <header>
      <title><xsl:value-of select="@title"/></title>
     </header>
     <body>
      <xsl:apply-templates/>
     </body>
    </document>
   </xsl:template>
  
   <xsl:template match="release">
    <s2 title="{$name} {@version} ({@date})">
     <sl>
      <xsl:apply-templates/>
     </sl>
    </s2>
   </xsl:template>
  
   <xsl:template match="action">
    <li>
     <icon src="images/{@type}.jpg" alt="{@type}"/>
     <xsl:apply-templates/>
     <xsl:text>(</xsl:text><xsl:value-of select="@dev"/><xsl:text>)</xsl:text>
  
     <xsl:if test="@due-to">
      <xsl:text> Thanks to </xsl:text>
      <link href="mailto:{@due-to-email}"><xsl:value-of select="@due-to"/></link>
      <xsl:text>.</xsl:text>
     </xsl:if>
  
     <xsl:if test="@fixes-bug">
      <xsl:text> Fixes </xsl:text>
      <link href="http://xml.apache.org/bugs/show_bug.cgi?id={@fixes-bug}">
       <xsl:text>bug </xsl:text><xsl:value-of select="@fixes-bug"/>
      </link>
      <xsl:text>.</xsl:text>
     </xsl:if>
    </li>
   </xsl:template>
  
   <xsl:template match="devs">
    <!-- remove -->
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/copyover.xsl
  
  Index: copyover.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="@*|node()">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/directory2project.xsl
  
  Index: directory2project.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:param name="base"/>
  
    <xsl:template match="directory">
      <project>
        <xsl:apply-templates/>
      </project>
    </xsl:template>
  
    <xsl:template match="entry">
      <xsl:if test="not(@directory)">
        <resource source="{@href}" target="{$base}{@href}"/>
      </xsl:if>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
  
   <xsl:import href="copyover.xsl"/>
  
   <xsl:param name="stylebook.project"/>
   <xsl:param name="copyright"/>
   <xsl:param name="id"/>
  
  <!-- ====================================================================== -->
  <!-- document section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="/">
    <!-- checks if this is the included document to avoid neverending loop -->
    <xsl:if test="not(book)">
      <html>
        <head>
          <title><xsl:value-of select="document/header/title"/></title>
          <link rel="stylesheet" type="text/css" href="resources/simple.css" title="Simple
Style"/>
        </head>
        <body>
  
          <!-- THE MAIN PANEL (SIDEBAR AND CONTENT) -->
          <table id="main-panel">
            <tr>
              <!-- THE SIDE BAR -->
              <td id="side-bar">
                <xsl:apply-templates select="document($stylebook.project)"/>
              </td>
              <!-- THE CONTENT PANEL -->
              <td id="content-panel">
                <xsl:apply-templates/>
              </td>
            </tr>
          </table>
        </body>
      </html>
     </xsl:if>
     
     <xsl:if test="book">
      <xsl:apply-templates/>
     </xsl:if>
    </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- book section -->
  <!-- ====================================================================== -->
  
    <xsl:template match="page|faqs|changes|todo|spec">
      <xsl:if test="@id=$id">
        <xsl:value-of select="@label"/>
      </xsl:if>
      <xsl:if test="@id!=$id">
        <a href="{@id}.html"><xsl:value-of select="@label"/></a>
      </xsl:if>
      <br/>
    </xsl:template>
  
    <xsl:template match="external">
      <a href="{@href}"><xsl:value-of select="@label"/></a><br/>
    </xsl:template>
  
    <xsl:template match="separator">
      <hr/>
    </xsl:template>
    
  <!-- ====================================================================== -->
  <!-- header section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="header">
    <!-- ignore on general document -->
   </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- body section -->
  <!-- ====================================================================== -->
  
    <xsl:template match="s1">
     <h1><xsl:value-of select="@title"/></h1>
  	<div id="s1"><xsl:apply-templates/></div>
    </xsl:template>
  
    <xsl:template match="s2">
     <h2><xsl:value-of select="@title"/></h2>
  	<div id="s2"><xsl:apply-templates/></div>
    </xsl:template>
  
    <xsl:template match="s3">
     <h3><xsl:value-of select="@title"/></h3>
  	<div id="s3"><xsl:apply-templates/></div>
    </xsl:template>
  
    <xsl:template match="s4">
     <h4><xsl:value-of select="@title"/></h4>
  	<div id="s4"><xsl:apply-templates/></div>
    </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- footer section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="footer">
    <!-- ignore on general documents -->
   </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- paragraph section -->
  <!-- ====================================================================== -->
  
    <xsl:template match="note">
     <p class="note"><xsl:apply-templates/></p>
    </xsl:template>
  
    <xsl:template match="source">
     <pre class="source"><xsl:apply-templates/></pre>
    </xsl:template>
  
    <xsl:template match="fixme">
     <!-- ignore on documentation -->
    </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- list section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="sl">
    <ul>
     <xsl:apply-templates/>
    </ul>
   </xsl:template>
  
   <xsl:template match="dt">
    <li>
     <strong><xsl:value-of select="."/></strong>
     <xsl:text> - </xsl:text>
     <xsl:value-of select="following::dd"/>   
    </li>
   </xsl:template>
   
   <xsl:template match="dd">
    <!-- ignore since already used -->
   </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- table section -->
  <!-- ====================================================================== -->
  
  <!-- since we cloned the XHTML model, we don't need any futher styling      -->
  
  <!-- ====================================================================== -->
  <!-- markup section -->
  <!-- ====================================================================== -->
  
  <!-- since we cloned the XHTML model, we don't need any futher styling      -->
   
  <!-- ====================================================================== -->
  <!-- images section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="figure|img|icon">
    <img src="{@src}" alt="{@alt}" class="{name(.)}"/>
   </xsl:template>
   
  <!-- ====================================================================== -->
  <!-- links section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="link">
     <a href="{@href}"><xsl:apply-templates/></a>
   </xsl:template>
  
   <xsl:template match="connect">
    <xsl:apply-templates/>
   </xsl:template>
  
   <xsl:template match="jump">
     <a href="{@href}#{@anchor}"><xsl:apply-templates/></a>
   </xsl:template>
  
   <xsl:template match="fork">
     <a href="{@href}" target="_blank"><xsl:apply-templates/></a>
   </xsl:template>
  
   <xsl:template match="anchor">
     <a name="{@id}"><xsl:comment>anchor</xsl:comment></a>
   </xsl:template>  
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/document2project.xsl
  
  Index: document2project.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="/">
      <project>
        <xsl:apply-templates/>
      </project>
    </xsl:template>
  
    <xsl:template match="img|figure|icon">
      <resource source="{@src}" target="{@src}"/>
    </xsl:template>
  
    <xsl:template match="node()">
      <xsl:apply-templates/>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/faqs2document.xsl
  
  Index: faqs2document.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <xsl:import href="copyover.xsl"/>
  
    <xsl:template match="faqs">
     <document>
      <header>
       <title><xsl:value-of select="@title"/></title>
      </header>
      <body>
        <s1 title="Questions">
         <ul>
          <xsl:apply-templates select="faq" mode="index"/>
         </ul>
        </s1>
        <s1 title="Answers">
          <xsl:apply-templates select="faq"/>
        </s1>
      </body>
     </document>  
    </xsl:template>
  
    <xsl:template match="faq" mode="index">
      <li>
        <jump anchor="faq-{position()}">
          <xsl:value-of select="question"/>
        </jump>
      </li>
    </xsl:template>
  
    <xsl:template match="faq">
      <anchor id="faq-{position()}"/>
      <s2 title="{question}">
        <xsl:apply-templates/>
      </s2>
    </xsl:template>
  
    <xsl:template match="question">
      <!-- ignored since already used -->
    </xsl:template>
  
    <xsl:template match="answer">
      <xsl:apply-templates/>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/scan4resources.xsl
  
  Index: scan4resources.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="/">
      <project>
        <xsl:apply-templates/>
      </project>
    </xsl:template>
  
    <xsl:template match="img|figure|icon">
      <resource source="{@src}" target="{@src}"/>
    </xsl:template>
  
    <xsl:template match="text()">
       <!-- ignore -->
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/spec2html.xsl
  
  Index: spec2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <!-- ====================================================================== -->
  <!-- inherit the document2html templates -->
  <!-- ====================================================================== -->
  
   <xsl:import href="document2html.xsl"/>
  
  <!-- ====================================================================== -->
  <!-- header -->
  <!-- ====================================================================== -->
  
   <xsl:template match="header">
     <table class="header">
      <tr>
       <td><b>Authors</b></td>
      </tr>
      <xsl:for-each select="authors/person">
       <tr>
        <td><b><xsl:value-of select="@name"/></b> - <xsl:value-of
select="@email"/></td>
       </tr>
      </xsl:for-each>
      <tr>
       <td>
        <b>Status</b>
       </td>
      </tr>
      <tr>
       <td><b><xsl:value-of select="type"/> - <xsl:value-of select="version"/></b></td>
      </tr>
      <tr>
       <td><b>Notice</b></td>
      </tr>
      <tr>
       <td><xsl:value-of select="notice"/></td>
      </tr>
      <tr>
       <td><b>Abstract</b></td>
      </tr>
      <tr>
       <td><xsl:value-of select="abstract"/></td>
      </tr>
     </table>
   </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- appendices section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="appendices">
    <xsl:apply-templates/>
   </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- bibliography -->
  <!-- ====================================================================== -->
  
   <xsl:template match="bl">
    <ul class="biblio">
     <xsl:apply-templates/>
    </ul>
   </xsl:template>
  
   <xsl:template match="bi">
    <li class="biblio">
     <b>
      <xsl:text>[</xsl:text>
       <a href="{@href}"><xsl:value-of select="@name"/></a>
      <xsl:text>]</xsl:text>
     </b>
     <xsl:text> &quot;</xsl:text>
     <xsl:value-of select="@title"/>
     <xsl:text>&quot;, </xsl:text>
     <xsl:value-of select="@authors"/>
     <xsl:if test="@date">
      <xsl:text>, </xsl:text>
      <xsl:value-of select="@date"/>
     </xsl:if>
    </li>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon/skins/printer/stylesheets/todo2document.xsl
  
  Index: todo2document.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <xsl:import href="copyover.xsl"/>
   
   <xsl:template match="todo">
    <document>
     <header>
      <title><xsl:value-of select="@title"/></title>
     </header>
     <body>
      <xsl:apply-templates/>
     </body>
    </document>
   </xsl:template>
  
   <xsl:template match="actions">
    <s2 title="{@priority}">
     <sl>
      <xsl:for-each select="action">
       <li>
        <strong><xsl:text>[</xsl:text><xsl:value-of select="@context"/><xsl:text>]</xsl:text></strong><xsl:text>
</xsl:text>
        <xsl:apply-templates/>
       </li>
      </xsl:for-each>
     </sl>
    </s2>
   </xsl:template>
   
  </xsl:stylesheet>
  
  

Mime
View raw message