anttasks.xml 2.8 KB

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