db2epub.xsl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <!-- ************** HTML ************** -->
  4. <xsl:import href="http://www.boost.org/tools/boostbook/xsl/html.xsl"/>
  5. <!--
  6. Make library documentation header using some elements from boostbook stylesheets.
  7. Override boost book implemenation of header.navigation with our own
  8. -->
  9. <xsl:template name = "header.navigation">
  10. <xsl:param name = "prev" select = "/foo"/>
  11. <xsl:param name = "next" select = "/foo"/>
  12. <xsl:param name = "nav.context"/>
  13. <table cellpadding = "2" width = "100%"><tr>
  14. <td valign = "top">
  15. <img href="index.html" height="164px" src="pre-boost.jpg" alt="Library Documentation Index" />
  16. </td>
  17. <td><h2>Safe Numerics</h2></td>
  18. </tr></table>
  19. <xsl:call-template name = "navbar.spirit">
  20. <xsl:with-param name = "prev" select = "$prev"/>
  21. <xsl:with-param name = "next" select = "$next"/>
  22. <xsl:with-param name = "nav.context" select = "$nav.context"/>
  23. </xsl:call-template>
  24. </xsl:template>
  25. <!-- remove "Chapter 1" from first page -->
  26. <xsl:param name="chapter.autolabel" select="0"/>
  27. <!-- leave the html files in the directory ../html -->
  28. <xsl:param name="base.dir" select="'../html/'"/>
  29. <!-- ******* Table of Contents ******** -->
  30. <!-- How far down sections get TOC's -->
  31. <xsl:param name = "toc.section.depth" select="2" />
  32. <!-- Max depth in each TOC: -->
  33. <xsl:param name = "toc.max.depth" select="2" />
  34. <!-- How far down we go with TOC's -->
  35. <xsl:param name="generate.section.toc.level" select="2" />
  36. <!-- ************ Chunking ************ -->
  37. <!--
  38. BoostBook takes a section node id like safe_numeric.safe_cast
  39. and renders it as safe_numeric/safe_cast. Presumably they do this
  40. so they can make a huge "book" with all the libraries in subdirectories.
  41. But we want something different. To my mind, this should have been
  42. done using the library "directory" attribute. But of course that
  43. doesn't matter now. We'll just re-hack the path to eliminate
  44. the "safe_numeric/" from the above example.
  45. -->
  46. <xsl:template match="*" mode="recursive-chunk-filename">
  47. <xsl:variable name="their">
  48. <xsl:apply-imports mode="recursive-chunk-filename" select="."/>
  49. </xsl:variable>
  50. <xsl:choose>
  51. <xsl:when test="contains($their, '/')">
  52. <xsl:value-of select="substring-after($their, '/')" />
  53. </xsl:when>
  54. <xsl:otherwise>
  55. <xsl:value-of select="$their"/>
  56. </xsl:otherwise>
  57. </xsl:choose>
  58. </xsl:template>
  59. <!-- don't make first sections special - leave TOC in different file -->
  60. <xsl:param name="chunk.first.sections" select="3" />
  61. <!-- How far down we chunk nested sections -->
  62. <!--
  63. Note: each chunk have to start with a section with an id
  64. Otherwise the chunk (i.e. file) will be lost. There is no
  65. checking of this
  66. -->
  67. <xsl:param name="chunk.section.depth" select="3" />
  68. </xsl:stylesheet>