The ASDoc tool that comes with Flex Builder and the Flex 2 SDK generates great looking docs from your ActionScript and MXML code, but it can drive other types of documents, reports, and processes too. All you need are these undocumented command-line parameters...and of course mega programming skills.
Here are some undocumented command-line parameters you can use with the ASDoc tool to make it even more useful.
ASDoc initially generates an XML file that contains all the metadata and documentation comments from your code. Then it applies XSL stylesheets to that XML to generate all that attractively formatted HTML output. Then it deletes the interim XML file.
If you use the -keep-xml option though it will save the interim XML file, which is named toplevel_classes.xml. The data in this file can be amazingly useful. We have used it many ways at Adobe, including:
- Converting to XMI files for input to UML modeling tools
- Generating code colorizing and hinting files for Flash 9
- Generating test scripts
- Experimenting with Flex-based documentation browsers
Even if your source code has no comments all the basic structural information about your code, covering things like packages, classes, methods, properties, and events, is output to the toplevel_classes.xml file as nice, structured XML.
The -skip-xsl parameter stops the ASDoc process before it generates the HTML output. It goes hand in hand with the -keep-xml parameter. When you use them in combination ASDoc will generate the toplevel_classes.xml file and then stop. This parameter isn't necessary, but it speeds up the build process if you don't care about generating the HTML.
If your source code generates a lot of warnings, you can use this parameter to stop them from cluttering the console.
The parameters above were added to ASDoc too late to get into the official documentation, but I do recommend you check out that documentation to learn how to run ASDoc and write good doc comments.
If you end up using the ASDoc XML to develop something new and interesting, please let me know!