A quick intro to a couple of documentation generators I have tried recently chxdoc and yuidoc.
Note that yuidoc is Javascript Documentation Tool which also works with Haxe.
chxdoc
Make sure you have chxdoc installed.
haxelib install chxdoc
chxdoc generates Java like documentation based on the XML output generated by haxe compiler using xml
compiler parameter as shown below.
haxe -xml docs.xml --macro include('pixi')
By default, compiler generates the xml documentation for haxe package and you can use macros to include custom packages like pixi
in the above sample.
When you have the xml documentation ready you can run chxdoc command and the following is the one I used to generate pixi.js haxe externs documentation.
haxelib run chxdoc -o output_folder -f docs.xml --deny=haxe.*,/ --title='Externs of pixi.js for Haxe' --subtitle='<a href='http://adireddy.github.io/haxe-pixi' target='_blank'>haxe-pixi</a>'
- output_folder - The folder path where you want the documentation to be generated
- –deny - You can specify the
,
separated list of all the packages you want to exclude from the documentation (haxe package and/
denotes root classes in the above sample).
I hope all the other options are self explanatory.
You can also use --developer=true
to generate developer documentation with all the private data documented.
YUIDoc
YUIDoc is much more simpler to use and I only tried it because pixi.js is using it for their documentation.
It’s is Node.js application and you should install it using node package manager npm -g install yuidocjs
I have created yuidoc.json
file to store the configuration.
{
"name": "haxe-pixi",
"description": "Haxe Pixi Externs",
"version": "2.1.9",
"url": "https://github.com/adireddy/haxe-pixi",
"options": {
"linkNatives": "true",
"attributesEmit": "true",
"selleck": "true",
"ignorePaths": [ "demos" ],
"paths": "*/hx",
"outdir": "yui"
}
}
Finally run the following command to generate the documentation.
yuidoc -e .hx .
Here is the link to haxe pixi externs YUIDoc documentation.
Any comments/queries, please post them in the comments section.