html-customization-header.dita 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <task id="custom-html-header">
  5. <title>Adding custom headers and footers</title>
  6. <titlealts>
  7. <navtitle>Headers and footers</navtitle>
  8. </titlealts>
  9. <shortdesc>You add a custom header to include a publication title, company logo, or other common branding elements in
  10. HTML output. A custom footer can also be added with copyright information, legal boilerplate, or other fine
  11. print.</shortdesc>
  12. <taskbody>
  13. <context>
  14. <p>In HTML5 output, the contents of the header file will be wrapped in an HTML5 <xmlelement>header</xmlelement>
  15. element with the <xmlatt>role</xmlatt> attribute set to <option>banner</option>.</p>
  16. <p>For example, the DITA-OT documentation includes a simple header banner with the publication title and a
  17. horizontal rule to separate the header from the generated topic content:
  18. <codeblock><coderef href="../resources/header.xml"/></codeblock>
  19. </p>
  20. <note>Header and footer files should be specified using absolute paths and must contain valid XML. A common
  21. practice is to place all content into a <xmlelement>div</xmlelement> element.</note>
  22. </context>
  23. <steps>
  24. <step>
  25. <cmd>Set <parmname>args.hdr</parmname> to include an XML file as a running header that appears above the page
  26. content.</cmd>
  27. <info> </info>
  28. </step>
  29. <step>
  30. <cmd>Set <parmname>args.ftr</parmname> to include an XML file as a running footer that appears below the page
  31. content.</cmd>
  32. </step>
  33. <step importance="optional">
  34. <cmd>Add custom CSS rules to style headers and/or footers.</cmd>
  35. <info>
  36. <p>For example, the DITA-OT documentation stylesheet includes the following header rules:
  37. <codeblock><coderef href="../resources/dita-ot-doc.css#token=header-coderef,end-header-ref"/></codeblock>
  38. </p>
  39. </info>
  40. </step>
  41. </steps>
  42. <result>
  43. <note type="tip">For an example of HTML output generated using this method, see the HTML5 version of the DITA-OT
  44. documentation included in the installation folder under <filepath>doc/index.html</filepath>.</note>
  45. </result>
  46. </taskbody>
  47. </task>