Search code examples
xmldocumentationhaxedocumentation-generationrtti

Haxe documentation XML: how to exclude standard library?


I want to make a small tool in Haxe, that inspects the haxedoc comments. I figured the best way to get these comments is to use the "haxe -xml" option, and load in the resulting XML file.

However, when I generate the XML, it seems to include the whole standard library in the output XML. When I pass this XML in to Dox, it generates documentation for my code and the standard library stuff, e.g. Class, Date, String, Enum...

Is this expected behaviour? Is there some way to exclude the standard library entries from the generated XML? Or should I write my tool to filter the XML based on package/filename/etc?

Here is my build script:

/build.hxml

-cp src
-neko main.n
--no-output
-xml bin/xml/neko.xml
--macro "include('doctest')"

Here's the file I want to generate XML for:

/src/doctest/Main.hx

package doctest;

//import neko.Lib;

/**
 * ...
 * @author jjokin
 */
class Main 
{
    static function main() 
    {
    }
}

/**
 * This class does some stuff.
 */
class DemoClass {
}

Solution

  • Okay, I think I've worked it out. The compiled XML must always include everything - such as Array, Enum, Class, List - since these are needed for compilation to other languages. I've had a look at Dox, and it has the options "-in/--include", and "-ex/--exclude", which lets you filter the elements to produce documentation for. So, my module will need to do something similar.