html-customization-properties-file.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 2019"><meta name="DC.rights.owner" content="(C) Copyright 2019"><meta name="DC.type" content="task"><meta name="description" content="You can also use a .properties file to reference a set of build parameters when building output with the dita command. The DITA-OT documentation uses a .properties file to include custom CSS, header branding, and table-of-contents navigation in the HTML5 output."><meta name="DC.subject" content="command, dita, .properties file, HTML, build properties, CSS"><meta name="keywords" content="command, dita, .properties file, HTML, build properties, CSS"><meta name="DC.relation" scheme="URI" content="../topics/html-customization.html"><meta name="DC.relation" scheme="URI" content="../topics/html-customization-parameters.html"><meta name="DC.relation" scheme="URI" content="../topics/html-customization-plugins.html"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="custom-html-properties-file"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Customizing HTML with a .properties file</title></head><body id="custom-html-properties-file"><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.3</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/customizing.html">Customizing DITA-OT</a><ul><li><a href="../topics/html-customization.html">Customizing HTML</a><ul><li><a href="../topics/html-customization-parameters.html">Setting HTML parameters</a></li><li class="active"><a href="../topics/html-customization-properties-file.html">Using a properties file</a></li><li><a href="../topics/html-customization-plugins.html">Custom HTML plug-ins</a></li></ul></li><li><a href="../topics/pdf-customization.html">Customizing PDF</a></li><li><a href="../topics/custom-plugins.html">Working with plug-ins</a></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/globalization.html">Globalizing DITA content</a></li><li><a href="../topics/rebuilding-docs.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">Customizing HTML with a <span class="ph filepath">.properties</span> file</h1>
  8. <div class="body taskbody"><p class="shortdesc">You can also use a <span class="ph filepath">.properties</span> file to reference a set of build parameters when
  9. building output with the <span class="keyword cmdname">dita</span> command. The DITA-OT documentation uses a
  10. <span class="ph filepath">.properties</span> file to include custom CSS, header branding, and table-of-contents navigation in
  11. the HTML5 output.</p>
  12. <section><div class="tasklabel"><h2 class="sectiontitle tasklabel">Procedure</h2></div><ol class="ol steps"><li class="li step stepexpand">
  13. <span class="ph cmd">Create a <span class="ph filepath">.properties</span> file to store the parameter settings for your
  14. customization.</span>
  15. <div class="itemgroup info">
  16. <div class="note tip note_tip"><span class="note__title">Tip:</span> You can use the <span class="ph filepath">.properties</span> for the DITA-OT documentation as a starting
  17. point for your own customizations. This file is available in the installation folder under
  18. <span class="ph filepath">docsrc/samples/properties/docs-build-html5.properties</span>.</div>
  19. </div>
  20. <div class="itemgroup stepxmp">
  21. <p class="p">For example:</p>
  22. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 1. </span>The <span class="ph filepath">docsrc/samples/properties/docs-build-html5.properties</span> file</figcaption>
  23. <pre class="pre codeblock language-properties normalize-space show-line-numbers show-whitespace"><code># Copy the custom .css file to the output directory:
  24. args.copycss = yes
  25. # Custom .css file used to style output:
  26. args.css = dita-ot-doc.css
  27. # Location of the copied .css file relative to the output:
  28. args.csspath = css
  29. # Directory that contains the custom .css file:
  30. args.cssroot = resources
  31. # Generate headings for sections within task topics:
  32. args.gen.task.lbl = YES
  33. # File that contains the running header content:
  34. args.hdr = ${basedir}/resources/header.xml
  35. # Base name of the Table of Contents file:
  36. args.html5.toc = toc
  37. # Generate a partial navigation TOC in topic pages:
  38. nav-toc = partial
  39. # Stop processing if there are any errors:
  40. processing-mode = strict</code></pre>
  41. </figure>
  42. </div>
  43. </li><li class="li step stepexpand">
  44. <span class="ph cmd">Reference your <span class="ph filepath">.properties</span> file with the <span class="keyword cmdname">dita</span> command when building
  45. your output.</span>
  46. <div class="itemgroup stepxmp">
  47. <pre class="pre codeblock"><code><span class="keyword cmdname">dita</span> <span class="keyword parmname">--input</span>=<var class="keyword varname">my.ditamap</var> <span class="keyword parmname">--format</span>=<span class="keyword option">html5</span> <span class="keyword parmname">--propertyfile</span>=<var class="keyword varname">my.properties</var></code></pre>
  48. </div>
  49. <div class="itemgroup info"></div>
  50. </li></ol></section>
  51. <section class="section result"><div class="tasklabel"><h2 class="sectiontitle tasklabel">Results</h2></div>
  52. <div class="note note note_note"><span class="note__title">Note:</span> For an example of HTML output generated using this method, see the HTML5 version of the DITA-OT
  53. documentation included in the installation folder under <span class="ph filepath">doc/index.html</span>.</div>
  54. </section>
  55. </div>
  56. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/html-customization.html" title="You can adjust the look and feel of your HTML output without creating a DITA-OT plug-in by including custom CSS, headers and footers, or table-of-contents navigation in topics.">Customizing HTML output</a></div></div><div class="linklist relinfo relconcepts"><strong>Related concepts</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../topics/html-customization-plugins.html" title="For more complex customizations, you can create custom DITA-OT plug-ins that bundle custom fonts, JavaScript, and stylesheets; modify the HTML markup, or override other aspects of HTML processing.">Custom HTML plug-ins</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/html-customization-parameters.html" title="For simple branded HTML pages, you can adjust the look and feel of the default output to match your company style by setting parameters to include custom CSS, header branding, or table-of-contents navigation in topics. (These changes do not require a custom plug-in.)">Setting parameters for custom HTML</a></li></ul></div></nav></article></main></body></html>