lfs-admon.xsl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns="http://www.w3.org/1999/xhtml"
  4. version="1.0">
  5. <!-- REVISED -->
  6. <!-- This stylesheet controls how admonitions are displayed -->
  7. <!-- Use graphics in admonitions? 1 = yes, 0 = no -->
  8. <xsl:param name="admon.graphics" select="1"/>
  9. <!-- Relative path to images directory. We set here relative path
  10. from sub-dirs HTML files. The path from top-level HTML files (index.html,
  11. partX.html, etc) MUST be fixed via a sed in the Makefile. -->
  12. <xsl:param name="admon.graphics.path">../images/</xsl:param>
  13. <!-- The images files extension -->
  14. <xsl:param name="admon.graphics.extension" select="'.png'"/>
  15. <!-- Changing the output tagging:
  16. Removed $admon.style support
  17. Hardcoded $admon.textlabel feature
  18. Changed the output format from table to nested divs -->
  19. <!-- The original template is in {docbook-xsl}/xhtml/admon.xsl -->
  20. <xsl:template name="graphical.admonition">
  21. <xsl:variable name="admon.type">
  22. <xsl:choose>
  23. <xsl:when test="local-name(.)='note'">Note</xsl:when>
  24. <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
  25. <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
  26. <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
  27. <xsl:when test="local-name(.)='important'">Important</xsl:when>
  28. <xsl:otherwise>Note</xsl:otherwise>
  29. </xsl:choose>
  30. </xsl:variable>
  31. <xsl:variable name="alt">
  32. <xsl:call-template name="gentext">
  33. <xsl:with-param name="key" select="$admon.type"/>
  34. </xsl:call-template>
  35. </xsl:variable>
  36. <div class="{name(.)}">
  37. <div class ="admonhead">
  38. <img alt="[{$alt}]">
  39. <xsl:attribute name="src">
  40. <xsl:call-template name="admon.graphic"/>
  41. </xsl:attribute>
  42. </img>
  43. <h3 class="admontitle">
  44. <xsl:apply-templates select="." mode="object.title.markup"/>
  45. </h3>
  46. </div>
  47. <div class="admonbody">
  48. <xsl:apply-templates/>
  49. </div>
  50. </div>
  51. </xsl:template>
  52. </xsl:stylesheet>