From: <nw...@us...> - 2006-09-30 18:58:14
|
Revision: 6336 http://svn.sourceforge.net/docbook/?rev=6336&view=rev Author: nwalsh Date: 2006-09-30 11:58:08 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Snapshot Modified Paths: -------------- trunk/slides2/html/slides.xsl Added Paths: ----------- trunk/slides2/html/plain.xsl Added: trunk/slides2/html/plain.xsl =================================================================== --- trunk/slides2/html/plain.xsl (rev 0) +++ trunk/slides2/html/plain.xsl 2006-09-30 18:58:08 UTC (rev 6336) @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:db="http://docbook.org/ns/docbook" + xmlns:f="http://docbook.org/xslt/ns/extension" + xmlns:h="http://www.w3.org/1999/xhtml" + xmlns:m="http://docbook.org/xslt/ns/mode" + xmlns:t="http://docbook.org/xslt/ns/template" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + exclude-result-prefixes="db f h m t xs" + version="2.0"> + +<!-- +xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" +xmlns:u="http://nwalsh.com/xsl/unittests#" +--> + +<xsl:import href="slides.xsl"/> + +<!-- ============================================================ --> + +<xsl:template name="t:head"> + <xsl:param name="notes" select="0" tunnel="yes"/> + + <title> + <xsl:choose> + <xsl:when test="db:info/db:title"> + <xsl:value-of select="db:info/db:title"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>???</xsl:text> + <xsl:message> + <xsl:text>Warning: no title for root element: </xsl:text> + <xsl:value-of select="local-name(.)"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </title> + + <link rel="stylesheet" type="text/css" href="plain.css" /> +</xsl:template> + +<xsl:template name="t:foil-footer"/> + +<xsl:template match="db:slides" mode="m:root"> + <xsl:if test="$save.normalized.xml != 0"> + <xsl:message>Saving normalized xml.</xsl:message> + <xsl:result-document href="normalized.xml"> + <xsl:copy-of select="."/> + </xsl:result-document> + </xsl:if> + + <html> + <head> + <xsl:call-template name="t:head"/> + </head> + <body> + <div class="titlepage"> + <h1> + <xsl:value-of select="db:info/db:title"/> + </h1> + <xsl:if test="db:info/db:subtitle"> + <h2> + <xsl:value-of select="db:info/db:subtitle"/> + </h2> + </xsl:if> + <div class="author"> + <xsl:apply-templates select="db:info/db:author" + mode="m:titlepage-mode"/> + <xsl:if test="db:info/db:author//db:orgname"> + <h4> + <xsl:value-of select="(db:info/db:author//db:orgname)[1]"/> + </h4> + </xsl:if> + </div> + </div> + + <div class="toc"> + <h1>Contents</h1> + <xsl:if test="db:foil"> + <ul> + <xsl:apply-templates select="db:foil" + mode="m:slidetoc"/> + </ul> + </xsl:if> + <xsl:if test="db:foilgroup"> + <ul> + <xsl:apply-templates select="db:foilgroup" + mode="m:slidetoc"/> + </ul> + </xsl:if> + </div> + + <xsl:apply-templates select="db:foil|db:foilgroup"/> + </body> + </html> +</xsl:template> + +<!-- ============================================================ --> + +<xsl:template match="db:foil|db:foilgroup"> + <div class="foil" id="{generate-id()}"> + <xsl:call-template name="t:foil-header"/> + <xsl:call-template name="t:foil-body"> + <xsl:with-param name="notes" select="0" tunnel="yes"/> + </xsl:call-template> + <xsl:call-template name="t:foil-footer"/> + </div> + + <xsl:apply-templates select="db:foil"/> +</xsl:template> + +<xsl:template match="db:speakernotes"/> + +<!-- ============================================================ --> + +<xsl:template match="db:foilgroup" mode="m:slidetoc"> + <li> + <a href="#{generate-id()}"> + <xsl:value-of select="db:info/db:title"/> + </a> + <ul> + <xsl:apply-templates select="db:foil" mode="m:slidetoc"/> + </ul> + </li> +</xsl:template> + +<xsl:template match="db:foil" mode="m:slidetoc"> + <li> + <a href="#{generate-id()}"> + <xsl:value-of select="db:info/db:title"/> + </a> + </li> +</xsl:template> + +</xsl:stylesheet> Modified: trunk/slides2/html/slides.xsl =================================================================== --- trunk/slides2/html/slides.xsl 2006-09-29 19:24:17 UTC (rev 6335) +++ trunk/slides2/html/slides.xsl 2006-09-30 18:58:08 UTC (rev 6336) @@ -31,7 +31,7 @@ <!-- ============================================================ --> <xsl:template name="t:head"> - <xsl:param name="notes" select="0"/> + <xsl:param name="notes" select="0" tunnel="yes"/> <title> <xsl:choose> @@ -93,6 +93,9 @@ </xsl:for-each> <xsl:call-template name="css-style"/> + <xsl:if test="$notes != 0"> + <link rel="stylesheet" type="text/css" href="notes.css" /> + </xsl:if> <script type="text/javascript" language="javascript" src="script/ua.js"/> <script type="text/javascript" language="javascript" src="script/xbDOM.js"/> @@ -114,6 +117,7 @@ </xsl:template> <xsl:template name="t:foil-body"> + <xsl:param name="notes" select="0" tunnel="yes"/> <div class="body"> <xsl:apply-templates select="node() except (db:foil|db:foilgroup)"/> @@ -128,7 +132,28 @@ <xsl:template name="t:foil-footer"> <div id="overlayDiv" class="footer"> - <xsl:apply-templates select="/db:slides/db:info/db:copyright"/> + + <table cellpadding="0" cellspacing="0" width="100%" summary="layout hack"> + <tr> + <td> </td> + <td> + <xsl:apply-templates select="/db:slides/db:info/db:copyright"/> + </td> + <td> + <xsl:text>Slide </xsl:text> + <xsl:value-of select="if (self::db:foil) + then count(preceding::db:foil) + +count(preceding::db:foilgroup) + +count(ancestor::db:foilgroup) + +1 + else count(preceding::db:foil) + +count(preceding::db:foilgroup) + +1"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="count(//db:foilgroup|//db:foil)"/> + </td> + </tr> + </table> </div> </xsl:template> @@ -147,11 +172,77 @@ <head> <xsl:call-template name="t:head"/> </head> - <body> - <h1>Slides info…</h1> + <body onload="newPage(1)" onkeypress="navigate(event)"> + <div class="titlepage"> + <h1> + <xsl:value-of select="db:info/db:title"/> + </h1> + <xsl:if test="db:info/db:subtitle"> + <h2> + <xsl:value-of select="db:info/db:subtitle"/> + </h2> + </xsl:if> + <div class="author"> + <xsl:apply-templates select="db:info/db:author" + mode="m:titlepage-mode"/> + <xsl:if test="db:info/db:author//db:orgname"> + <h4> + <xsl:value-of select="(db:info/db:author//db:orgname)[1]"/> + </h4> + </xsl:if> + </div> + <div id="overlayDiv" class="overlayDiv"></div> + </div> </body> </html> </xsl:result-document> + + <xsl:result-document href="notes.html"> + <html> + <head> + <xsl:call-template name="t:head"> + <xsl:with-param name="notes" select="1"/> + </xsl:call-template> + </head> + <body onload="newPage(1)" onkeypress="navigate(event)"> + <h1> + <xsl:value-of select="db:info/db:title"/> + </h1> + <p>Start of presentation</p> + <div id="overlayDiv" class="overlayDiv"></div> + </body> + </html> + </xsl:result-document> + + <xsl:result-document href="startup.html"> + <html> + <head> + <xsl:call-template name="t:head"> + <xsl:with-param name="notes" select="1"/> + </xsl:call-template> + </head> + <body onload="newPage(1)" onkeypress="navigate(event)"> + <h1> + <xsl:value-of select="db:info/db:title"/> + </h1> + <ul> + <li> + <a href="index.html" target="presentation"> + <xsl:text>Open presentation</xsl:text> + </a> + </li> + <!-- + <li> + <a href="notes.html" target="notes"> + <xsl:text>Open notes</xsl:text> + </a> + </li> + --> + </ul> + <div id="overlayDiv" class="overlayDiv"></div> + </body> + </html> + </xsl:result-document> <xsl:apply-templates select="db:foil|db:foilgroup"/> @@ -201,7 +292,9 @@ <body onload="newPage(1)" onkeypress="navigate(event)"> <div class="foil"> <xsl:call-template name="t:foil-header"/> - <xsl:call-template name="t:foil-body"/> + <xsl:call-template name="t:foil-body"> + <xsl:with-param name="notes" select="0" tunnel="yes"/> + </xsl:call-template> <xsl:call-template name="t:foil-footer"/> </div> </body> @@ -212,13 +305,23 @@ <html> <head> <xsl:call-template name="t:head"> - <xsl:with-param name="notes" select="1"/> + <xsl:with-param name="notes" select="1" tunnel="yes"/> </xsl:call-template> <link rel="bookmark" href="{f:filename(.,0)}" title="Foil"/> </head> <body onload="newPage(1)" onkeypress="navigate(event)"> <div class="speakernotes"> <xsl:call-template name="t:foil-header"/> + <div class="thumbnail"> + <xsl:apply-templates select="node() except db:foil"> + <xsl:with-param name="notes" select="1" tunnel="yes"/> + </xsl:apply-templates> + <xsl:if test="self::db:foilgroup"> + <ul> + <xsl:apply-templates select="db:foil" mode="m:slidetoc"/> + </ul> + </xsl:if> + </div> <xsl:if test="db:speakernotes"> <div class="notes"> <h2>Notes</h2> @@ -226,9 +329,6 @@ </div> </xsl:if> <xsl:call-template name="t:foil-footer"/> - <div class="thumbnail"> - <xsl:apply-templates select="node() except db:foil"/> - </div> </div> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |