Adding a new transformation type
Plug-ins can add an entirely new transformation type. The new transformation type can be very simple, such as an HTML build that creates an additional control file; it also can be very complex, adding any number of new processing steps.
About this task
You can use the
<transtype> element to define a new transformation type with any new
custom parameters that are supported.
When a transformation type is defined, the build expects Ant code to be integrated to define the transformation process. The Ant code must define a target based on the name of the transformation type; if the transformation type is "new-transform", the Ant code must define a target named dita2new-transform.
- Create an Ant project file for the new transformation. This project file must define a target named "dita2new-transtype," where new-transtype is the name of the new transformation type.
Create a plugin.xml with the following content:
<plugin id="plugin-id"> <transtype name="new-transtype"/> <feature extension="dita.transtype.print" value="new-transtype"/> <feature extension="ant.import" file="ant-file"/> </plugin>
- plugin-id is the plug-in identifier, for example, com.dita-ot.pdf.
- new-transtype is the name of the new transformation, for example, dita-ot-pdf.
- ant-file is the name of the Ant file, for example, build-dita-ot-pdf.xml.
Exclude the content that is highlighted in bold if the transformation is not intended for print.
- Install the plug-in.