lfs-admon.xsl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  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. <!-- Path to admonition graphics relative to index.xml -->
  10. <xsl:param name="admon.graphics.path" select="'images/'"/>
  11. <!-- Global admonitions properties -->
  12. <xsl:attribute-set name="graphical.admonition.properties">
  13. <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
  14. <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
  15. <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
  16. <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
  17. <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
  18. <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
  19. <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
  20. <xsl:attribute name="padding-start">5pt</xsl:attribute>
  21. <xsl:attribute name="padding-top">5pt</xsl:attribute>
  22. <xsl:attribute name="padding-bottom">5pt</xsl:attribute>
  23. <xsl:attribute name="border-style">solid</xsl:attribute>
  24. <xsl:attribute name="border-width">1pt</xsl:attribute>
  25. <xsl:attribute name="background-color">#FFFFE6</xsl:attribute>
  26. <xsl:attribute name="border-color">
  27. <xsl:choose>
  28. <xsl:when test="self::note | self::tip">#E0E0E0</xsl:when>
  29. <xsl:otherwise>#500</xsl:otherwise>
  30. </xsl:choose>
  31. </xsl:attribute>
  32. </xsl:attribute-set>
  33. <!-- Properties for admonitions titles -->
  34. <xsl:attribute-set name="admonition.title.properties">
  35. <xsl:attribute name="font-size">14pt</xsl:attribute>
  36. <xsl:attribute name="font-weight">bold</xsl:attribute>
  37. <xsl:attribute name="hyphenate">false</xsl:attribute>
  38. <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
  39. <xsl:attribute name="color">
  40. <xsl:choose>
  41. <xsl:when test="ancestor-or-self::important | ancestor-or-self::warning
  42. | ancestor-or-self::caution">#500</xsl:when>
  43. <xsl:otherwise>#000</xsl:otherwise>
  44. </xsl:choose>
  45. </xsl:attribute>
  46. </xsl:attribute-set>
  47. <!-- Properties for admonitions text -->
  48. <xsl:attribute-set name="admonition.properties">
  49. <xsl:attribute name="margin-right">5pt</xsl:attribute>
  50. </xsl:attribute-set>
  51. <!-- admon.graphic.width:
  52. Making the graphic smaller. -->
  53. <!-- The original template is in {docbook-xsl}/fo/admon.xsl -->
  54. <xsl:template match="*" mode="admon.graphic.width">
  55. <xsl:param name="node" select="."/>
  56. <xsl:text>24pt</xsl:text>
  57. </xsl:template>
  58. </xsl:stylesheet>