Create new plug-in
Create a new directory in /plugins directory, such as
/plugin/pluginA.
Under the created directory, include the following
subdirectories:plugins/
pluginA/
dtd
schema
catalog
xsl
libNot
all above subdirectories are required. However, it is strongly suggested to use the
structure and those subdirectories above to make all files systematically. You also can
create files under other directories, such as python/ or vb/.
Specify the types of topic, such as task, reference or concept.
Put the dtd files into dtd directory.
Put schema files into schema directory.
Put the necessary catalog information about the plug-in from your
own catalog file into catalog directory.
Define the transformation for the new specialization and put it
into xsl directory.
Provide the Ant script to use the xsl file with preprocess with
default ant script template, and put it into pluginA root directory.
Put the complied necessary JAR files into lib directory.
Provide a description file named puglin.xml in pluginA root directory.
It informs the toolkit how to integrate the function of the new plug-in.
This file is an xml file. It's not validated by either dtd file or schema
file. Following specification shows you how to write the description file:
An example of the plugin.xml is shown below:<plugin id="org.dita.dost.pluginA">
<require plugin="base_pluginA"/>
<feature extension="dita.conductor.lib.import" value="pluginA.jar" type="file"/>
<feature extension="dita.conductor.transtype.check" value="newoutput" type="txt"/>
<feature extension="dita.conductor.target" value="pluginA_antscript.xml" type="file"/>
<feature extension="dita.specialization.catalog" value="pluginA_catalog-dita.xml" type="file"/>
<feature extension="dita.xsl.xhtml" value="xsl/pluginA2xhtml.xsl" type="file"/>
</plugin>
Use <plugin></plugin> tagsto define the root element for
plugin.xml. Set the id attribute, which is uniqute and necessary for each
plug-in.
Under <plugin> element, use <require> element to specify
which plug-in is needed by pluginA. The plugin attribute is used to specify
the ID of the plug-in which is needed by pluginA. This element
is not necessary if pluginA is loaded as an independent plug-in. However,
pluginA might not function after being loaded if another plug-in is needed,
which is not specified by a <require> element.
The <feature> tag specifies the extension point that is extended
and how it's extended in pluginA. For example, <feature
extension="dita.xsl.xhtml" value="xsl/pluginA2xhtml.xsl" type="file"/> means
adding new specific logic transformed from DITA to xhtml into pluginA. The
logic is written in file xsl/pluginA2xhtml.xsl in pluginA directory. type="file" means
that the type of value is file name.Another example, <feature
extension="dita.conductor.transtype.check" value="newoutput" type="txt"/> means
extending "dita.conductor.transtype.check" in pluginA. Another type of transformation
output for DITA-OT and the check logic for parameter transtype in DITA-OT
are to be added. The new transformation output is named newoutput. type="txt" means
the value is text not a file name.There are certain extension
point which can be defined here. See for
more details.
Package all the subdirectories and files under pluginA to a zip
binary file. Create a DITA Open Toolkit plug-in file for distribution.
Test the usability of plug-in files when integrating into DITA
Opent Toolkit base.
Put the zip binary file on a Web site, such as the DITA OT SourceForge
Web site.