DITA-OT Plugins Development
Local DITA-OT Overview
You can install the DITA Open Toolkit publishing engine locally to quickly test and troubleshoot your plugins without the need to upload them to easyDITA.
Overview
The DITA-OT is a command-line utility. You operate the local DITA-OT by using your operating system shell. The DITA-OT runs on Windows, macOS, and Linux.
Shell
Each major operating system has a built-in shell application that enables you to interact with the DITA Open Toolkit from the command line.
Operation
You use the DITA-OT by entering dita at the command prompt followed by any applicable arguments.
Install DITA-OT Locally
The DITA Open Toolkit installation is slightly different for Windows, macOS, and Linux.
Run the DITA Command from Anywhere
Adding the DITA-OT to the PATH system variable enables you to run the dita command from any location in the system.
- For Windows, do the following:
- For macOS, do the following:
Install a DITA OT Plugin Locally
You can install a DITA Open Toolkit plugin by moving the plugin folder and running the dita --install command.
- Install the DITA Open Toolkit publishing engine locally. See Install DITA-OT Locally.
- Obtain the plugin that you want to install on your local DITA-OT instance.Tip: You can generate or develop your own DITA-OT plugins. For more information, see integrator.xml and Developing a DITA-OT Plugin.
Publish Content with Local DITA-OT
You can transform the DITA source to various output formats by using a local instance of the DITA Open Toolkit.
- Install the DITA-OT publishing engine locally. See Install DITA-OT Locally.
- If needed, install the DITA-OT plugin that you want to use in publishing. See Install a DITA OT Plugin Locally.
Generating a DITA-OT PDF Plugin
You can use the DITA-OT PDF Plugin Generator to quickly create customized PDF plugins.
DITA-OT Plugin Generator
The DITA-OT Plugin Generator is a free online tool that enables you to easily build custom DITA-OT PDF plugins.
Generate a DITA-OT PDF Plugin
The DITA-OT PDF Plugin Generator enables you to quickly create custom PDF plugins for the DITA Open Toolkit.
- To apply advanced customizations to your plugin. See Developing a DITA-OT Plugin.
Developing a DITA-OT Plugin
You can develop your own DITA Open Toolkit plugins to extensively customize your deliverables in various formats.
Default Plugins
The DITA-OT comes with a set of default plugins that can transform your content to various formats such as PDF or HTML5. The default plugins have basic styling applied. You can create custom plugins to apply styling and branding to the default plugins.
By default, the DITA-OT 3.4 includes the following plugins:
org.dita.base
org.dita.eclipsehelp
org.dita.html5
org.dita.htmlhelp
org.dita.index
org.dita.normalize
org.dita.pdf2
org.dita.pdf2.axf
org.dita.pdf2.fop
org.dita.pdf2.xep
org.dita.specialization.dita11
org.dita.xhtml
org.lwdita
org.oasis-open.dita.v1_2
org.oasis-open.dita.v1_3
org.oasis-open.xdita.v0_2_2
Plugins Development
For more information, development conventions, and good practices, see Working with Plugins.
Develop a DITA-OT Plugin
You can develop a DITA Open Toolkit plugin by customizing a default DITA-OT plugin.
- Install the DITA-OT on your workstation.
See Install DITA-OT Locally.Note: The DITA-OT installs with a set of default plugins that you can use as base plugins for your own plugins development.
- Review the best practices recommended for plugin development. See https://www.dita-ot.org/dev/topics/plugin-best-practices.html.
plugin.xml
The plugin.xml file specifies the basic information about your plugin.
Template
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="dita-ot/plugin.rnc" type="application/relax-ng-compact-syntax"?>
<plugin id="plugin_id">
<require plugin="plugin_required"/>
<transtype name="transtype" extends="extended_transtype" desc="plugin_description" />
<feature extension="ant.import" file="integrator.xml" />
</plugin>
Variable | Description | Example |
---|---|---|
plugin_id | Plugin identifier. The plugin identifier should match the plugin folder name. | com.custom.pdf |
plugin_required | The base plugin identifier that you modify. In most cases, the base plugin identifier matches the base plugin folder name. | org.dita.pdf2 |
transtype | The name of the transformation type. You use the transformation type when publishing your DITA content. | custom-pdf |
extended_transtype | The name of the transformation type that your plugin extends. This is the transformation type associated with the base plugin that you modify. | pdf2 |
plugin_description | The description of the plugin. | PDF styled by KRN-Solutions © |
integrator.xml
The integrator.xml file specifies your plugin properties and customization files locations.
Template
<?xml version="1.0" encoding="UTF-8" ?>
<project>
<target name="dita2transtype" depends="dita2transtype.init, dita2extended_transtype />
<target name="dita2transtype.init">
<property name="customization.dir" location="${dita.plugin.com.plugin_id}/customization_dir" />
properties
</target>
</project>
Variable | Description | Example |
---|---|---|
transtype | The name of the transformation type. You use the transformation type when publishing your DITA content. | custom-pdf |
extended_transtype | The name of the transformation type that your plugin extends. This is the transformation type associated with the base plugin that you modify. | pdf2 |
plugin_id | Plugin identifier. The plugin identifier should match the plugin folder name. | com.custom.pdf |
customization_dir | The customization directory of your plugin. The customization directory should reflect the base plugin structure. | cfg |
properties | For more information about the available properties, see https://www.dita-ot.org/dev/parameters/parameters_intro.html. |
|