plugin-best-practices.html 6.6 KB

12345678910111213141516171819202122232425262728293031
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><meta name="description" content="Adhering to certain development practices will properly isolate your code from that of the DITA Open Toolkit. This will make it easier to you to upgrade to new versions of the DITA-OT when they are released."><meta name="DC.Relation" scheme="URI" content="../topics/custom-plugins.html"><meta name="DC.Relation" scheme="URI" content="../topics/pdf-customization.html"><meta name="DC.Relation" scheme="URI" content="../topics/pdf-customization-approaches.html"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="best-practices-pdf-customization-plugins"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Best practices for custom plug-ins</title></head><body id="best-practices-pdf-customization-plugins"><header role="banner"><div class="header">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.0</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../topics/installing-client.html">Installing DITA-OT</a></li><li><a href="../topics/alternative-input-formats.html">Authoring formats</a></li><li><a href="../topics/building-output.html">Building output</a></li><li><a href="../parameters/index.html">Setting parameters</a></li><li><a href="../topics/extending-the-ot.html">Customizing DITA-OT</a><ul><li><a href="../topics/html-customization.html">Customizing HTML</a></li><li><a href="../topics/pdf-customization.html">Customizing PDF</a></li><li><a href="../topics/globalization.html">Globalizing DITA content</a></li><li><a href="../topics/custom-plugins.html">Custom plug-ins</a><ul><li><a href="../topics/plugins-installing.html">Installing plug-ins</a></li><li><a href="../topics/plugins-removing.html">Removing plug-ins</a></li><li><a href="../topics/plugin-configfile.html">Plug-in descriptor file</a></li><li><a href="../topics/plugin-dependencies.html">Plug-in dependencies</a></li><li><a href="../topics/plugin-applications.html">Plug-in applications</a></li><li><a href="../topics/plugin-sample.html">Example plugin.xml file</a></li><li class="active"><a href="../topics/plugin-best-practices.html">Best practices for plug-ins</a></li></ul></li><li><a href="../extension-points/plugin-extension-points.html">Extension points</a></li><li><a href="../topics/migration.html">Migrating customizations</a></li><li><a href="../topics/rebuilding-the-dita-ot-documentation.html">Rebuilding documentation</a></li></ul></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a></li><li><a href="../reference/index.html">Reference</a></li><li><a href="../topics/dita-and-dita-ot-resources.html">Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
  7. <h1 class="title topictitle1" id="ariaid-title1">Best practices for custom plug-ins</h1>
  8. <div class="body conbody"><p class="shortdesc">Adhering to certain development practices will properly isolate your code from that of the DITA Open
  9. Toolkit. This will make it easier to you to upgrade to new versions of the DITA-OT when they are
  10. released.</p>
  11. <ul class="ul">
  12. <li class="li">Use a properly-constructed DITA-OT plug-in.</li>
  13. <li class="li">Use a version control system to store your code.</li>
  14. <li class="li">Never modify any of the core DITA-OT code.<div class="note tip note_tip"><span class="note__title">Tip:</span> You may want to set the permissions on default
  15. plug-in directories such as <span class="ph filepath">org.dita.pdf2</span> to “read-only” to ensure that you do not
  16. accidentally modify the files within as you develop your customized plug-in.</div></li>
  17. <li class="li">Avoid copying entire DITA-OT files into your customization plug-in. When you only copy the attribute sets and
  18. templates that you need to override, there is less risk of impact from new features or fixes in the base code,
  19. making your code more stable and easier to upgrade between releases.</li>
  20. <li class="li">If you only need to change a few attribute sets and templates, you may prefer to store your overrides in
  21. <span class="ph filepath">custom.xsl</span> files, or a simple folder hierarchy within your custom plug-in.</li>
  22. <li class="li">In cases that require substantial customizations, you may prefer to organize the files in a folder structure
  23. that mimics the hierarchy of the default plug-in you are customizing. This facilitates comparisons with the
  24. default settings in the base plug-in and makes it easier to migrate your changes to new toolkit versions.</li>
  25. <li class="li">Upgrade your customization plug-in to new versions of the DITA-OT regularly. Do not wait through several major
  26. releases before upgrading.</li>
  27. </ul>
  28. </div>
  29. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/custom-plugins.html" title="You can install or create DITA-OT plug-ins to change the default output types in various ways, add entirely new kinds of output formats, or implement DITA topic specializations.">Customizing DITA-OT with plug-ins</a></div></div><div class="linklist relinfo relconcepts"><strong>Related concepts</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../topics/pdf-customization-approaches.html" title="Various methods may be used to customize the PDF output produced by the DITA Open Toolkit. Each of these approaches have advantages and shortcomings that should be considered when preparing a customization project. Some of these methods are considered “anti-patterns” with disadvantages that outweigh their apparent appeal. In most cases, you should create a custom PDF plug-in.">PDF customization approaches</a></li></ul></div><div class="linklist relinfo reltasks"><strong>Related tasks</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../topics/pdf-customization.html" title="You can create custom DITA-OT plug-ins that build on the default DITA to PDF transformation. Plug-ins can customize covers and page layouts, modify formatting, override logic of the default PDF plug-in, and much more.">Customizing PDF output</a></li></ul></div></nav></article></main></body></html>