Using a DITA template for Eclipse document plug-ins

You can use a template to develop a documentation plug-in with DITA in Eclipse PDE. When you want to develop a documentation plug-in with DITA in Eclipse, you cannot use the previous releases of DITA OT in Eclipse to transform DITA to HTML.

Although previous releases of DITA OT supported transforming DITA files to an Eclipse documentation plug-in, they were not integrated with Eclipse. With DITA OT 1.3 integrated with WPT, you can develop document plug-ins with DITA in the Eclipse PDE and build and package the final plug-in by taking the following steps.

  1. Create a new PDE project in Eclipse, and apply the DITA template to the project by following the wizard.
    Start Eclipse and create a new plug-in project
  2. Set the source directory, the main ditamap file, the output directory (the default value is the root directory of the project), css storage directory (used to contain common.css, commonltr.css, and commonrtl.css), user customized .css file name, and conditional processing ditaval file in the wizard. Use root as output directory is selected as the default.

    Set directories
    You can also clear Use root as the output directory and specify another output directory.

    Specify another directory
  3. Create DITA files in the source directory and a ditamap to include the topic files that you created.
  4. Optional: Import the DITA files into the src directory of the DITA plug-in project you just created.
    1. Right-click a directory where you want to put the imported files and select Import, and then File system.

      Select an import file source
    2. Select the directory under which you put the DITA files.

      Select a directory
    3. Click Finish after you selected the DITA files under the specified directory. The DITA files are then imported to your DITA project.
  5. Right-click build.xml, select Run As, and then ANT Build. After the transformation, the output is in the output directory set in build.xml. Refresh the project after the build is successful.

    Run as ANT build
  6. Edit the plug-in description of the property file MANITEST.MF in the plug-in editor after you run the Ant build successfully.
    1. Click MANITEST.MF to go to the Overview page.

      Overview
    2. Edit Dependencies to include org.eclipse.help

      Edit Dependencies
    3. Edit Extensions to add org.eclipse.help.toc; right-click the added prgeclipse.help.toc, and select New, and then toc.

      Edit Extensions
    4. Edit the Build Configuration to include the out directory or the directory you specified above.

      Edit Build Configuration
    5. Save the changes you made to the property file MANITEST.MF.
  7. Export the output to a documentation plug-in.
    Note: build.xml can be customized to meet the requirement of headless build.
    1. Select File > Export ; select "Deployable plug-ins and fragments" and click Next.

      Export a plug-in
    2. Select the plug-in you want to export and specify a directory under which you want to put the plug-in package.
      Select a plug-in and specify the export destination
    3. Click Finish to export the plug-in package.