kawa.xsl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:d="http://docbook.org/ns/docbook"
  3. version="1.0">
  4. <!--<xsl:import href="html/chunktoc.xsl"/>-->
  5. <xsl:import href="chunkfast.xsl"/>
  6. <xsl:import href="docbook-to-html.xsl"/>
  7. <xsl:param name="html.namespace"></xsl:param>
  8. <!-- Dummy - not actually used, except needs to be non-empty,
  9. so output.html.stylesheets gets called. -->
  10. <xsl:param name="html.stylesheet">style/kawa-l.css</xsl:param>
  11. <xsl:template name="output.html.stylesheets">
  12. <xsl:variable name="href">
  13. <xsl:call-template name="relative.path.link">
  14. <xsl:with-param name="target.pathname" select="Community.html"/>
  15. </xsl:call-template>
  16. </xsl:variable>
  17. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  18. <link rel="stylesheet" title="Kawa (navbar: fixed, left)"
  19. href="{$href}style/kawa-l.css" media="screen, print, projection, tv"/>
  20. <link rel="alternate stylesheet" title="Kawa (navbar: fixed, right)"
  21. href="{$href}style/kawa-r.css" media="screen, print, projection, tv"/>
  22. <link rel="alternate stylesheet" title="Single column, top navigation" href="{$href}style/kawa-1col.css" type="text/css" media="handheld, screen, print, projection, tv"/>
  23. </xsl:template>
  24. <!-- Change metatitle (window titlebar) to "Kawa: PAGE-TITLE" -->
  25. <xsl:template match="*" mode="object.title.markup.textonly">
  26. <xsl:variable name="title">
  27. <xsl:apply-templates select="." mode="object.title.markup"/>
  28. </xsl:variable>Kawa: <xsl:value-of select="normalize-space($title)"/>
  29. </xsl:template>
  30. <!-- Same as in common/common.xsl except for using $object/title. -->
  31. <xsl:template name="object.id">
  32. <xsl:param name="object" select="."/>
  33. <xsl:choose>
  34. <xsl:when test="$object/@id">
  35. <xsl:value-of select="$object/@id"/>
  36. </xsl:when>
  37. <xsl:when test="$object/@xml:id">
  38. <xsl:value-of select="$object/@xml:id"/>
  39. </xsl:when>
  40. <!-- If $object has a title child, use that. -->
  41. <xsl:when test="$object/d:title">
  42. <xsl:value-of select="translate($object/d:title,' ','-')"/>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:value-of select="generate-id($object)"/>
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xsl:template>
  49. <xsl:template name="user.header.logo">
  50. <xsl:variable name="href">
  51. <xsl:call-template name="relative.path.link">
  52. <xsl:with-param name="target.pathname" select="Community.html"/>
  53. </xsl:call-template>
  54. </xsl:variable>
  55. <div class="logo"><a href="{$href}index.html" title="Kawa Home"><div><img src="{$href}style/kawa-logo.png"/><span>The Kawa Scheme language</span></div></a></div>
  56. </xsl:template>
  57. </xsl:stylesheet>