lfs-admon.xsl 3.1 KB

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