lfs-mixed.xsl 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. <!-- Shade screen -->
  6. <xsl:param name="shade.verbatim" select="1"/>
  7. <!-- Graphics in admonitions -->
  8. <xsl:param name="admon.graphics" select="1"/>
  9. <xsl:param name="admon.graphics.path"
  10. select="'/usr/share/xml/docbook/xsl-stylesheets-1.65.1/images/'"/>
  11. <!-- Admonition block properties -->
  12. <xsl:template match="important|warning|caution">
  13. <xsl:choose>
  14. <xsl:when test="$admon.graphics != 0">
  15. <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
  16. space-before.maximum="0.8em" border-style="solid" border-width="1pt"
  17. border-color="#500" background-color="#FFFFE6">
  18. <xsl:call-template name="graphical.admonition"/>
  19. </fo:block>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <xsl:call-template name="nongraphical.admonition"/>
  23. </xsl:otherwise>
  24. </xsl:choose>
  25. </xsl:template>
  26. <xsl:template match="note|tip">
  27. <xsl:choose>
  28. <xsl:when test="$admon.graphics != 0">
  29. <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
  30. space-before.maximum="0.8em" border-style="solid" border-width="1pt"
  31. border-color="#E0E0E0" background-color="#FFFFE6">
  32. <xsl:call-template name="graphical.admonition"/>
  33. </fo:block>
  34. </xsl:when>
  35. <xsl:otherwise>
  36. <xsl:call-template name="nongraphical.admonition"/>
  37. </xsl:otherwise>
  38. </xsl:choose>
  39. </xsl:template>
  40. <!-- Admonitions text properties -->
  41. <xsl:attribute-set name="admonition.properties">
  42. <xsl:attribute name="margin-right">12pt</xsl:attribute>
  43. </xsl:attribute-set>
  44. <!-- Adding left space to the graphics and color to the titles -->
  45. <xsl:template name="graphical.admonition">
  46. <xsl:variable name="id">
  47. <xsl:call-template name="object.id"/>
  48. </xsl:variable>
  49. <xsl:variable name="graphic.width">
  50. <xsl:call-template name="admon.graphic.width"/>
  51. </xsl:variable>
  52. <fo:block id="{$id}">
  53. <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
  54. provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing">
  55. <fo:list-item>
  56. <fo:list-item-label end-indent="label-end()">
  57. <fo:block margin-left="4pt">
  58. <fo:external-graphic width="auto" height="auto"
  59. content-width="{$graphic.width}" >
  60. <xsl:attribute name="src">
  61. <xsl:call-template name="admon.graphic"/>
  62. </xsl:attribute>
  63. </fo:external-graphic>
  64. </fo:block>
  65. </fo:list-item-label>
  66. <fo:list-item-body start-indent="body-start()">
  67. <xsl:if test="$admon.textlabel != 0 or title">
  68. <fo:block xsl:use-attribute-sets="admonition.title.properties">
  69. <xsl:if test="ancestor-or-self::important">
  70. <xsl:attribute name="color">#500</xsl:attribute>
  71. </xsl:if>
  72. <xsl:if test="ancestor-or-self::warning">
  73. <xsl:attribute name="color">#500</xsl:attribute>
  74. </xsl:if>
  75. <xsl:if test="ancestor-or-self::caution">
  76. <xsl:attribute name="color">#500</xsl:attribute>
  77. </xsl:if>
  78. <xsl:apply-templates select="." mode="object.title.markup"/>
  79. </fo:block>
  80. </xsl:if>
  81. <fo:block xsl:use-attribute-sets="admonition.properties">
  82. <xsl:apply-templates/>
  83. </fo:block>
  84. </fo:list-item-body>
  85. </fo:list-item>
  86. </fo:list-block>
  87. </fo:block>
  88. </xsl:template>
  89. <!-- How is rendered by default a variablelist -->
  90. <xsl:param name="variablelist.as.blocks" select="1"/>
  91. <!-- Adding space before segmentedlist -->
  92. <xsl:template match="segmentedlist">
  93. <!--<xsl:variable name="presentation">
  94. <xsl:call-template name="pi-attribute">
  95. <xsl:with-param name="pis"
  96. select="processing-instruction('dbfo')"/>
  97. <xsl:with-param name="attribute" select="'list-presentation'"/>
  98. </xsl:call-template>
  99. </xsl:variable>
  100. <xsl:choose>
  101. <xsl:when test="$presentation = 'table'">
  102. <xsl:apply-templates select="." mode="seglist-table"/>
  103. </xsl:when>
  104. <xsl:when test="$presentation = 'list'">
  105. <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
  106. space-before.maximum="0.8em">
  107. <xsl:apply-templates/>
  108. </fo:block>
  109. </xsl:when>
  110. <xsl:when test="$segmentedlist.as.table != 0">
  111. <xsl:apply-templates select="." mode="seglist-table"/>
  112. </xsl:when>
  113. <xsl:otherwise>-->
  114. <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
  115. space-before.maximum="0.8em">
  116. <xsl:apply-templates/>
  117. </fo:block>
  118. <!--</xsl:otherwise>
  119. </xsl:choose>-->
  120. </xsl:template>
  121. </xsl:stylesheet>