lfs-admon.xsl 2.8 KB

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