Ant tasks

The tocjs extension is meant to work with a project that generates HTML. For instance, assume you have an existing ant task: <target name="myproj2html" depends="use-init"> <antcall target="dita2xhtml"> <param name="args.input" value="projects${file.separator}myproject${file.separator}GettingStartedGuide.ditamap"/> <param name="output.dir" value="output${file.separator}myproject"/> <param name="args.css" value="testvalue.css"/> </antcall> </target> To create tocjs JavaScript output and copy related topics into place, you could create the following ant target. <target name="myproj2tocjs" description="Generate tocjs javascript file"> <antcall target="dita2tocjs"> <param name="transtype" value="tocjs"/> <param name="args.input" value="projects${file.separator}myproject${file.separator}GettingStartedGuide.ditamap"/> <param name="output.file" value="output${file.separator}myproject${file.separator}myproject${file.separator}toctree.js"/> </antcall> <copy todir="output${file.separator}myproject${file.separator}myproject"> <fileset dir="${dita.dir}${file.separator}demo${file.separator}tocjs${file.separator}basefiles"> <include name="**/*"/></fileset> </copy> </target> The above task generates tocjs output and copies the related files from the tocjs basefiles directory. You will also need to maitan and copy into place a frameset file. For an exaple of how this is done, take a look at the ant tasks in demo/tocjs/buildsample.xml and the related basefiles directories

For more examples of working ant tasks, check the buildsample.xmlfile in the demo/tocjs directory.