anttasks.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. See the accompanying LICENSE file for applicable license.
  5. Copyright 2007 Shawn McKenzie
  6. *-->
  7. <?xml-stylesheet href="../../../../xsl/ditaview_shell.xsl" type="text/xsl"?>
  8. <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
  9. "../../../../dtd/concept.dtd">
  10. <concept id="tocjs_ant" xml:lang="en-us">
  11. <title>Ant tasks</title>
  12. <conbody>
  13. <p>The tocjs extension is meant to work with a project that generates HTML. For instance, assume you have an existing ant task:
  14. <codeblock>
  15. &lt;target name=&quot;myproj2html&quot; depends=&quot;use-init&quot;&gt;
  16. &lt;antcall target=&quot;dita2xhtml&quot;&gt;
  17. &lt;param name=&quot;args.input&quot;
  18. value=&quot;projects${file.separator}myproject${file.separator}GettingStartedGuide.ditamap&quot;/&gt;
  19. &lt;param name=&quot;output.dir&quot; value=&quot;output${file.separator}myproject&quot;/&gt;
  20. &lt;param name=&quot;args.css&quot; value=&quot;testvalue.css&quot;/&gt;
  21. &lt;/antcall&gt;
  22. &lt;/target&gt;
  23. </codeblock>
  24. To create tocjs JavaScript output and copy related topics into place, you could create the following
  25. ant target.
  26. <codeblock>
  27. &lt;target name=&quot;myproj2tocjs&quot; description=&quot;Generate tocjs javascript file&quot;&gt;
  28. &lt;antcall target=&quot;dita2tocjs&quot;&gt;
  29. &lt;param name=&quot;transtype&quot; value=&quot;tocjs&quot;/&gt;
  30. &lt;param name=&quot;args.input&quot;
  31. value=&quot;projects${file.separator}myproject${file.separator}GettingStartedGuide.ditamap&quot;/&gt;
  32. &lt;param name=&quot;output.file&quot;
  33. value=&quot;output${file.separator}myproject${file.separator}myproject${file.separator}toctree.js&quot;/&gt;
  34. &lt;/antcall&gt;
  35. &lt;copy todir=&quot;output${file.separator}myproject${file.separator}myproject&quot;&gt;
  36. &lt;fileset dir=&quot;${dita.dir}${file.separator}demo${file.separator}tocjs${file.separator}basefiles&quot;&gt;
  37. &lt;include name=&quot;**/*&quot;/&gt;&lt;/fileset&gt;
  38. &lt;/copy&gt;
  39. &lt;/target&gt;
  40. </codeblock>
  41. The above task generates tocjs output and copies the related files from the tocjs
  42. <filepath>basefiles</filepath> directory. You will also need to maitan and copy into place a
  43. frameset file. For an exaple of how this is done, take a look at the ant tasks in
  44. <filepath>demo/tocjs/buildsample.xml</filepath> and the related <filepath>basefiles</filepath>
  45. directories</p>
  46. <note type="tip">For more examples of working ant tasks, check the
  47. <filepath>buildsample.xml</filepath>file in the <filepath>demo/tocjs</filepath> directory.</note>
  48. </conbody>
  49. <related-links>
  50. <link href="basefiles.xml"/>
  51. <link href="paths.xml"/>
  52. </related-links>
  53. </concept>