lfs-admon.xsl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns="http://www.w3.org/1999/xhtml"
  5. version="1.0">
  6. <!-- Use graphics in admonitions -->
  7. <xsl:param name="admon.graphics" select="1"/>
  8. <xsl:param name="admon.graphics.path">../images/</xsl:param>
  9. <xsl:param name="admon.graphics.extension" select="'.png'"/>
  10. <!-- Changing the output tagging -->
  11. <xsl:template name="graphical.admonition">
  12. <xsl:variable name="admon.type">
  13. <xsl:choose>
  14. <xsl:when test="local-name(.)='note'">Note</xsl:when>
  15. <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
  16. <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
  17. <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
  18. <xsl:when test="local-name(.)='important'">Important</xsl:when>
  19. <xsl:otherwise>Note</xsl:otherwise>
  20. </xsl:choose>
  21. </xsl:variable>
  22. <div class="admonition">
  23. <div class ="admonhead">
  24. <img alt="[{$admon.type}]">
  25. <xsl:attribute name="src">
  26. <xsl:call-template name="admon.graphic"/>
  27. </xsl:attribute>
  28. </img>
  29. <h3 class="{name(.)}">
  30. <xsl:value-of select="$admon.type"/>
  31. <xsl:if test="title">
  32. <xsl:text>: </xsl:text>
  33. <xsl:value-of select="title"/>
  34. </xsl:if>
  35. </h3>
  36. </div>
  37. <div class="admonbody">
  38. <xsl:apply-templates/>
  39. </div>
  40. </div>
  41. </xsl:template>
  42. </xsl:stylesheet>