lfs-admon.xsl 2.0 KB

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