extension-points.xsl 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. exclude-result-prefixes="xs"
  5. version="2.0">
  6. <xsl:output doctype-public="-//OASIS//DTD DITA Reference//EN"
  7. doctype-system="reference.dtd"/>
  8. <xsl:strip-space elements="*"/>
  9. <xsl:param name="output-dir.url"/>
  10. <xsl:template match="/">
  11. <xsl:call-template name="all"/>
  12. <xsl:call-template name="separate"/>
  13. </xsl:template>
  14. <xsl:template name="all">
  15. <xsl:comment> Generated from plugin source, do not edit! </xsl:comment>
  16. <reference id="all-extension-points">
  17. <title id="title" outputclass="generated">All DITA-OT extension points</title>
  18. <titlealts>
  19. <navtitle>All extension points</navtitle>
  20. </titlealts>
  21. <shortdesc id="shortdesc">The pre-defined extension points can be used to add new functionality to DITA-OT. If
  22. your toolkit installation includes custom plug-ins that define additional extension points, you can add to this
  23. list by rebuilding the DITA-OT documentation.</shortdesc>
  24. <refbody>
  25. <section>
  26. <dl>
  27. <xsl:apply-templates select="//extension-point" mode="reuse">
  28. <xsl:sort select="@name"/>
  29. </xsl:apply-templates>
  30. </dl>
  31. </section>
  32. </refbody>
  33. </reference>
  34. </xsl:template>
  35. <xsl:template name="separate">
  36. <!--xsl:for-each select="//transtype/param"-->
  37. <xsl:for-each select="//plugin">
  38. <xsl:variable name="id" select="@id"/>
  39. <xsl:message>Writing <xsl:value-of select="$output-dir.url"/>extension-points-in-<xsl:value-of select="$id"/>.dita</xsl:message>
  40. <xsl:result-document href="{$output-dir.url}/extension-points-in-{$id}.dita"
  41. doctype-public="-//OASIS//DTD DITA Reference//EN"
  42. doctype-system="reference.dtd">
  43. <xsl:comment> Generated from plugin source, do not edit! </xsl:comment>
  44. <reference id="{$id}-ext">
  45. <title outputclass="generated">
  46. <xsl:text>Extension points in </xsl:text>
  47. <codeph><xsl:value-of select="@id"/></codeph>
  48. </title>
  49. <titlealts>
  50. <navtitle id="navtitle">
  51. <xsl:value-of select="(transtype/@desc)[1]"/>
  52. </navtitle>
  53. </titlealts>
  54. <shortdesc id="shortdesc">The <codeph><xsl:value-of select="@id"/></codeph> plug-in provides extension points
  55. to modify <xsl:value-of select="(transtype/@desc)[1]"/> processing.</shortdesc>
  56. <refbody>
  57. <section>
  58. <dl>
  59. <xsl:apply-templates select="extension-point">
  60. <xsl:sort select="@id"/>
  61. </xsl:apply-templates>
  62. </dl>
  63. </section>
  64. </refbody>
  65. </reference>
  66. </xsl:result-document>
  67. </xsl:for-each>
  68. </xsl:template>
  69. <!--xsl:template match="transtype" mode="inherit" as="element(param)*">
  70. <xsl:sequence select="param"/>
  71. <xsl:variable name="extends" as="xs:string?">
  72. <xsl:choose>
  73. <xsl:when test="@name = 'base'"/>
  74. <xsl:when test="@extends">
  75. <xsl:value-of select="@extends"/>
  76. </xsl:when>
  77. <xsl:otherwise>base</xsl:otherwise>
  78. </xsl:choose>
  79. </xsl:variable>
  80. <xsl:if test="exists($extends)">
  81. <xsl:apply-templates select="//transtype[tokenize(@name, '\s+') = $extends]" mode="inherit"/>
  82. </xsl:if>
  83. </xsl:template-->
  84. <xsl:template match="extension-point">
  85. <dlentry id="{@id}">
  86. <xsl:if test="@deprecated = 'true'">
  87. <xsl:attribute name="importance">deprecated</xsl:attribute>
  88. </xsl:if>
  89. <xsl:if test="@required = 'true'">
  90. <xsl:attribute name="importance">required</xsl:attribute>
  91. </xsl:if>
  92. <dt>
  93. <parmname>
  94. <xsl:value-of select="@id"/>
  95. </parmname>
  96. <ph>
  97. <indexterm>
  98. <parmname><xsl:value-of select="@id"/></parmname>
  99. </indexterm>
  100. <indexterm>extension points<indexterm>
  101. <parmname><xsl:value-of select="@id"/></parmname>
  102. </indexterm></indexterm>
  103. </ph>
  104. <xsl:if test="parent::*[@deprecated = 'true']">
  105. <ph>
  106. <indexterm>deprecated features<indexterm>extension points<indexterm>
  107. <parmname><xsl:value-of select="@id"/></parmname>
  108. </indexterm></indexterm>
  109. </indexterm>
  110. </ph>
  111. </xsl:if>
  112. </dt>
  113. <dd id="{@id}.desc">
  114. <xsl:value-of select="@name"/>
  115. </dd>
  116. </dlentry>
  117. </xsl:template>
  118. <xsl:template match="extension-point" mode="reuse">
  119. <xsl:variable name="containing-plugin" select="ancestor::plugin/@id"/>
  120. <dlentry id="{@id}">
  121. <xsl:if test="@deprecated = 'true'">
  122. <xsl:attribute name="importance">deprecated</xsl:attribute>
  123. </xsl:if>
  124. <xsl:if test="@required = 'true'">
  125. <xsl:attribute name="importance">required</xsl:attribute>
  126. </xsl:if>
  127. <dt>
  128. <parmname>
  129. <xsl:value-of select="@id"/>
  130. </parmname>
  131. <ph>
  132. <indexterm>
  133. <parmname><xsl:value-of select="@id"/></parmname>
  134. </indexterm>
  135. <indexterm>extension points<indexterm>
  136. <parmname><xsl:value-of select="@id"/></parmname>
  137. </indexterm></indexterm>
  138. </ph>
  139. <xsl:if test="parent::*[@deprecated = 'true']">
  140. <ph>
  141. <indexterm>deprecated features<indexterm>extension points<indexterm>
  142. <parmname><xsl:value-of select="@id"/></parmname>
  143. </indexterm></indexterm>
  144. </indexterm>
  145. </ph>
  146. </xsl:if>
  147. </dt>
  148. <!-- Changing the keyref to "extension-points-in-{$containing-plugin}/{@id}" would link to the exact parameter. -->
  149. <dd>Defined in plug-in
  150. <xref keyref="extension-points-in-{$containing-plugin}">
  151. <codeph><xsl:value-of select="$containing-plugin"/></codeph>
  152. </xref>.
  153. </dd>
  154. <dd conkeyref="extension-points-in-{$containing-plugin}/{@id}.desc" id="{@id}.desc"/>
  155. </dlentry>
  156. </xsl:template>
  157. </xsl:stylesheet>