plugin-best-practices.dita 2.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <concept id="best-practices-pdf-customization-plugins">
  5. <title>Best practices for custom plug-ins</title>
  6. <titlealts>
  7. <navtitle>Best practices for plug-ins</navtitle>
  8. </titlealts>
  9. <shortdesc>Adhering to certain development practices will properly isolate your code from that of the DITA Open
  10. Toolkit. This will make it easier to you to upgrade to new versions of the DITA-OT when they are
  11. released.</shortdesc>
  12. <conbody>
  13. <ul>
  14. <li>Use a properly-constructed DITA-OT plug-in.</li>
  15. <li>Use a version control system to store your code.</li>
  16. <li>Never modify any of the core DITA-OT code.<note type="tip">You may want to set the permissions on default
  17. plug-in directories such as <filepath>org.dita.pdf2</filepath> to “read-only” to ensure that you do not
  18. accidentally modify the files within as you develop your customized plug-in.</note></li>
  19. <li>Avoid copying entire DITA-OT files into your customization plug-in. When you only copy the attribute sets and
  20. templates that you need to override, there is less risk of impact from new features or fixes in the base code,
  21. making your code more stable and easier to upgrade between releases.</li>
  22. <li>If you only need to change a few attribute sets and templates, you may prefer to store your overrides in
  23. <filepath>custom.xsl</filepath> files, or a simple folder hierarchy within your custom plug-in.</li>
  24. <li>In cases that require substantial customizations, you may prefer to organize the files in a folder structure
  25. that mimics the hierarchy of the default plug-in you are customizing. This facilitates comparisons with the
  26. default settings in the base plug-in and makes it easier to migrate your changes to new toolkit versions.</li>
  27. <li>Upgrade your customization plug-in to new versions of the DITA-OT regularly. Do not wait through several major
  28. releases before upgrading.</li>
  29. </ul>
  30. </conbody>
  31. </concept>