lfs-admon.xsl 3.1 KB

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