plugin-configfile.dita 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <reference id="plugin-configfile" xml:lang="en-US">
  5. <title>Plug-in descriptor file</title>
  6. <shortdesc>The plug-in descriptor file (<filepath>plugin.xml</filepath>) controls all aspects of a plug-in, making
  7. each extension visible to the rest of the toolkit. The file uses pre-defined extension points to locate changes, and
  8. then integrates those changes into the core DITA-OT code.</shortdesc>
  9. <prolog>
  10. <metadata>
  11. <keywords>
  12. <indexterm>plug-ins<indexterm>identfiers</indexterm></indexterm>
  13. <indexterm>plug-ins<indexterm><filepath>plugin.xml</filepath></indexterm></indexterm>
  14. <indexterm>metadata<indexterm>plug-in</indexterm></indexterm>
  15. </keywords>
  16. </metadata>
  17. </prolog>
  18. <refbody>
  19. <section conkeyref="reusable-components/validating-plugins"/>
  20. <section>
  21. <title>Plug-in identifiers</title>
  22. <div outputclass="div-index">
  23. <indexterm><xmlatt>id</xmlatt><indexterm>plug-in</indexterm></indexterm>
  24. </div>
  25. <p>Every DITA-OT plug-in must have a unique identifier composed of one or more dot-delimited tokens, for example,
  26. <codeph>com.example.rss</codeph>. This identifier is used to identify the plug-in to the toolkit for
  27. installation, processing, and when determining plug-in dependencies.</p>
  28. <note>The default DITA-OT plug-ins use a reverse domain naming convention, as in <codeph>org.dita.html5</codeph>;
  29. this is strongly recommended to avoid plug-in naming conflicts.</note>
  30. <p id="tokendef">Each token can include only the following characters:
  31. <ul>
  32. <li>Lower-case letters (a-z)</li>
  33. <li>Upper-case letters (A-Z)</li>
  34. <li>Numerals (0-9)</li>
  35. <li>Underscores (_)</li>
  36. <li>Hyphens (-)</li>
  37. </ul></p>
  38. </section>
  39. <section>
  40. <title><xmlelement>plugin</xmlelement></title>
  41. <p>The root element of the <filepath>plugin.xml</filepath> file is <xmlelement>plugin</xmlelement>, which has a
  42. required <xmlatt>id</xmlatt> attribute set to the unique plug-in identifier.</p>
  43. <fig>
  44. <title>Sample <xmlelement>plugin</xmlelement> element</title>
  45. <codeblock outputclass="language-xml"><coderef href="../samples/plugins/com.example.html5-javascript/plugin.xml#line=3,4"/></codeblock>
  46. </fig>
  47. </section>
  48. <section>
  49. <title>Plug-in elements</title>
  50. <div outputclass="div-index">
  51. <indexterm><xmlelement>plugin</xmlelement></indexterm>
  52. </div>
  53. <draft-comment author="Kristen Eberlein" time="13 May 2013">Perhaps all the following tables should have a Data
  54. type column? That would match with the DITA spec; also, it seems as if some attributes must take a predefined
  55. set of values.</draft-comment>
  56. <p>The <xmlelement>plugin</xmlelement> element can contain the following child elements: </p>
  57. <parml>
  58. <plentry>
  59. <pt><xmlelement>extension-point</xmlelement></pt>
  60. <pd>
  61. <indexterm><xmlelement>extension-point</xmlelement></indexterm>
  62. <p>An optional element that defines a new extension point that can be used by other DITA-OT plug-ins.</p>
  63. <p>The following attributes are supported:</p>
  64. <simpletable keycol="1">
  65. <sthead>
  66. <stentry>Attribute</stentry>
  67. <stentry>Description</stentry>
  68. <stentry>Required?</stentry>
  69. </sthead>
  70. <strow>
  71. <stentry>id</stentry>
  72. <stentry>Extension point identifier</stentry>
  73. <stentry>Yes</stentry>
  74. </strow>
  75. <strow>
  76. <stentry>name</stentry>
  77. <stentry>Extension point description</stentry>
  78. <stentry>No</stentry>
  79. </strow>
  80. </simpletable>
  81. <p id="extension-point-ids">Like plug-in identifiers, extension point identifiers are composed of one or
  82. more dot-delimited tokens.</p>
  83. <note id="entension-point-ids-note">Extension point identifiers should begin with the identifier of the
  84. defining plug-in and append one or more tokens, for example, <codeph>org.dita.example.pre</codeph>.</note>
  85. <fig>
  86. <title>Sample <xmlelement>extension-point</xmlelement> element</title>
  87. <codeblock outputclass="language-xml">&lt;extension-point id="dita.xsl.html5" name="HTML5 XSLT import"/></codeblock>
  88. </fig>
  89. </pd>
  90. </plentry>
  91. <plentry>
  92. <pt><xmlelement>feature</xmlelement></pt>
  93. <pd>
  94. <indexterm><xmlelement>feature</xmlelement></indexterm>
  95. <indexterm><xmlatt>value</xmlatt></indexterm>
  96. <indexterm><xmlatt>file</xmlatt></indexterm>
  97. <p>An optional element that supplies values to a DITA-OT extension point.</p>
  98. <p>The following attributes are supported:</p>
  99. <simpletable keycol="1">
  100. <sthead>
  101. <stentry>Attribute</stentry>
  102. <stentry>Description</stentry>
  103. <stentry>Required?</stentry>
  104. </sthead>
  105. <strow>
  106. <stentry>extension</stentry>
  107. <stentry>Identifier of the DITA-OT extension point</stentry>
  108. <stentry>Yes</stentry>
  109. </strow>
  110. <strow>
  111. <stentry>value</stentry>
  112. <stentry>Comma separated string value of the extension</stentry>
  113. <stentry>Either the <xmlatt>value</xmlatt> or <xmlatt>file</xmlatt> attribute must be
  114. specified</stentry>
  115. </strow>
  116. <strow>
  117. <stentry>file</stentry>
  118. <stentry>Name and path of a file containing data for the extension point.
  119. <p>Depending on the extension point, this might be specified as an absolute path, a path relative to
  120. the <filepath>plugin.xml</filepath> file, or a path relative to the DITA-OT root.</p></stentry>
  121. <stentry>Either the <xmlatt>value</xmlatt> or <xmlatt>file</xmlatt> attribute must be
  122. specified</stentry>
  123. </strow>
  124. <strow>
  125. <stentry>type</stentry>
  126. <stentry>Type of the <xmlatt>value</xmlatt> attribute</stentry>
  127. <stentry>No</stentry>
  128. </strow>
  129. </simpletable>
  130. <fig>
  131. <title>Sample <xmlelement>feature</xmlelement> elements</title>
  132. <p>If more than one <xmlelement>feature</xmlelement> element supplies values to the same extension point,
  133. the values are additive. For example, the following are equivalent:</p>
  134. <codeblock outputclass="language-xml">&lt;feature extension="org.dita.example.extension-point" value="a,b,c"/></codeblock>
  135. <codeblock outputclass="language-xml">&lt;feature extension="org.dita.example.extension-point" value="a"/>
  136. &lt;feature extension="org.dita.example.extension-point" value="b"/>
  137. &lt;feature extension="org.dita.example.extension-point" value="c"/></codeblock>
  138. </fig>
  139. </pd>
  140. </plentry>
  141. <plentry>
  142. <pt><xmlelement>meta</xmlelement></pt>
  143. <pd>
  144. <indexterm><xmlelement>meta</xmlelement></indexterm>
  145. <p>An optional element that defines metadata.</p>
  146. <p>The following attributes are supported:</p>
  147. <simpletable keycol="1">
  148. <sthead>
  149. <stentry>Attribute</stentry>
  150. <stentry>Description</stentry>
  151. <stentry>Required?</stentry>
  152. </sthead>
  153. <strow>
  154. <stentry>type</stentry>
  155. <stentry>Metadata name </stentry>
  156. <stentry>Yes</stentry>
  157. </strow>
  158. <strow>
  159. <stentry>value</stentry>
  160. <stentry>Metadata value</stentry>
  161. <stentry>Yes</stentry>
  162. </strow>
  163. </simpletable>
  164. <fig>
  165. <title>Sample <xmlelement>meta</xmlelement> element</title>
  166. <codeblock outputclass="language-xml">&lt;meta type="foo" value="bar"/></codeblock>
  167. </fig>
  168. </pd>
  169. </plentry>
  170. <plentry>
  171. <pt><xmlelement>require</xmlelement></pt>
  172. <pd>
  173. <indexterm><xmlelement>require</xmlelement></indexterm>
  174. <p>An optional element that defines plug-in dependencies.</p>
  175. <p>The following attributes are supported:</p>
  176. <simpletable keycol="1">
  177. <sthead>
  178. <stentry>Attribute</stentry>
  179. <stentry>Description</stentry>
  180. <stentry>Required?</stentry>
  181. </sthead>
  182. <strow>
  183. <stentry>plugin</stentry>
  184. <stentry>The identifier of the required plug-in.
  185. <p>To specify alternative requirements, separate plug-in identifiers with a vertical
  186. bar.</p></stentry>
  187. <stentry>Yes</stentry>
  188. </strow>
  189. <strow>
  190. <stentry>importance</stentry>
  191. <stentry>Identifies whether the plug-in is <codeph>required</codeph> (default) or
  192. <codeph>optional</codeph>. DITA-OT provides a warning if a required plug-in is not
  193. available.</stentry>
  194. <stentry>No</stentry>
  195. </strow>
  196. </simpletable>
  197. <fig>
  198. <title>Sample <xmlelement>require</xmlelement> element</title>
  199. <codeblock outputclass="language-xml normalize-space"><coderef href="../samples/plugins/com.example.html5-javascript/plugin.xml#line=4,5"/></codeblock>
  200. </fig>
  201. </pd>
  202. </plentry>
  203. <plentry>
  204. <pt><xmlelement>template</xmlelement></pt>
  205. <pd>
  206. <indexterm><xmlelement>template</xmlelement></indexterm>
  207. <indexterm><xmlelement>dita:extension</xmlelement></indexterm>
  208. <p>An optional element that defines files that should be treated as templates.</p>
  209. <p>Template files can be used to integrate DITA-OT extensions. Templates typically extend the default
  210. transformation-type-specific build files via <xmlelement>dita:extension</xmlelement> elements. When the
  211. plug-in installation process runs, template files are used to recreate build files, and the specified
  212. extension points are replaced with references to the appropriate plug-ins.</p>
  213. <p>The following attributes are supported:</p>
  214. <simpletable keycol="1">
  215. <sthead>
  216. <stentry>Attribute</stentry>
  217. <stentry>Description</stentry>
  218. <stentry>Required?</stentry>
  219. </sthead>
  220. <strow>
  221. <stentry>file</stentry>
  222. <stentry>Name and path to the template file, relative to the <filepath>plugin.xml</filepath>
  223. file</stentry>
  224. <stentry>Yes</stentry>
  225. </strow>
  226. </simpletable>
  227. <fig>
  228. <title>Sample <xmlelement>template</xmlelement> element</title>
  229. <codeblock outputclass="language-xml">&lt;template file="build_dita2html5_template.xml"/></codeblock>
  230. </fig>
  231. </pd>
  232. </plentry>
  233. <plentry>
  234. <pt><xmlelement>transtype</xmlelement></pt>
  235. <pd>
  236. <indexterm><xmlelement>transtype</xmlelement><indexterm><filepath>plugin.xml</filepath></indexterm></indexterm>
  237. <p>An optional element that defines a new output format (transformation type).</p>
  238. <p>The following attributes are supported:</p>
  239. <simpletable keycol="1">
  240. <sthead>
  241. <stentry>Attribute</stentry>
  242. <stentry>Description</stentry>
  243. <stentry>Required?</stentry>
  244. </sthead>
  245. <strow>
  246. <stentry>name</stentry>
  247. <stentry>Transformation name</stentry>
  248. <stentry>Yes</stentry>
  249. </strow>
  250. <strow>
  251. <stentry>desc</stentry>
  252. <stentry>Transformation type description</stentry>
  253. <stentry>No</stentry>
  254. </strow>
  255. <strow>
  256. <stentry>abstract</stentry>
  257. <stentry>When <option>true</option>, sets the transformation type as <q>abstract</q>, meaning it can be
  258. extended by other plug-ins, but cannot be used directly.
  259. <p>For example, the <codeph>org.dita.base</codeph> plug-in defines an abstract <q>base</q>
  260. transformation type that is extended by other DITA-OT plug-ins.</p></stentry>
  261. <stentry>No</stentry>
  262. </strow>
  263. <strow>
  264. <stentry>extends</stentry>
  265. <stentry>Specifies the name of the transformation type being extended</stentry>
  266. <stentry>No</stentry>
  267. </strow>
  268. </simpletable>
  269. <fig>
  270. <title>Sample <xmlelement>transtype</xmlelement> element</title>
  271. <codeblock outputclass="language-xml">&lt;transtype name="base" abstract="true" desc="Common">
  272. &lt;!-- ⋮ -->
  273. &lt;param name="link-crawl"
  274. desc="Specifies whether to crawl only topic links found in maps, or all discovered topic links."
  275. type="enum">
  276. &lt;val>map&lt;/val>
  277. &lt;val default="true">topic&lt;/val>
  278. &lt;/param>
  279. &lt;!-- ⋮ -->
  280. &lt;/transtype>
  281. </codeblock>
  282. </fig>
  283. <p>The <xmlelement>transtype</xmlelement> element may define additional parameters for the transformation
  284. type using the following child elements.</p>
  285. <parml>
  286. <plentry>
  287. <pt><xmlelement>param</xmlelement></pt>
  288. <pd>
  289. <indexterm><xmlelement>param</xmlelement></indexterm>
  290. <p>An optional element that specifies a parameter for the transformation type.</p>
  291. <p>The following parameter attributes are supported:</p>
  292. <simpletable keycol="1">
  293. <sthead>
  294. <stentry>Attribute</stentry>
  295. <stentry>Description</stentry>
  296. <stentry>Required?</stentry>
  297. </sthead>
  298. <strow>
  299. <stentry>name</stentry>
  300. <stentry>Parameter name</stentry>
  301. <stentry>Yes</stentry>
  302. </strow>
  303. <strow>
  304. <stentry>desc</stentry>
  305. <stentry>Parameter description</stentry>
  306. <stentry>No</stentry>
  307. </strow>
  308. <strow>
  309. <stentry>type</stentry>
  310. <stentry>Parameter type (<option>enum</option>, <option>file</option>,
  311. <option>string</option>)</stentry>
  312. <stentry>Yes</stentry>
  313. </strow>
  314. <strow>
  315. <stentry>deprecated</stentry>
  316. <stentry>When <option>true</option>, identifies this parameter as deprecated</stentry>
  317. <stentry>No</stentry>
  318. </strow>
  319. <strow>
  320. <stentry>required</stentry>
  321. <stentry>When <option>true</option>, identifies this parameter as required</stentry>
  322. <stentry>No</stentry>
  323. </strow>
  324. </simpletable></pd>
  325. </plentry>
  326. <plentry>
  327. <pt><xmlelement>val</xmlelement></pt>
  328. <pd>
  329. <indexterm><xmlelement>val</xmlelement></indexterm>
  330. <p>A child of <xmlelement>param</xmlelement> (when <xmlatt>type</xmlatt>=<option>enum</option>) that
  331. specifies an enumeration value.</p>
  332. <p>The following attributes are supported:</p>
  333. <simpletable keycol="1">
  334. <sthead>
  335. <stentry>Attribute</stentry>
  336. <stentry>Description</stentry>
  337. <stentry>Required?</stentry>
  338. </sthead>
  339. <strow>
  340. <stentry>default</stentry>
  341. <stentry>When <option>true</option>, sets the enumeration value as the default value of the parent
  342. <xmlelement>param</xmlelement></stentry>
  343. <stentry>Only for the default <xmlelement>val</xmlelement></stentry>
  344. </strow>
  345. </simpletable></pd>
  346. </plentry>
  347. </parml>
  348. </pd>
  349. </plentry>
  350. </parml>
  351. <p>Any extension that is not recognized by DITA-OT is ignored. Since DITA-OT version 1.5.3, you can combine
  352. multiple extension definitions within a single <filepath>plugin.xml</filepath> file; in older versions, only the
  353. last extension definition was used.</p>
  354. </section>
  355. </refbody>
  356. </reference>