Asdocgen in openfl

Hello,

is there an equivalent to asdocgen in openfl ?

thanks

The tool that’s usually used for generating API docs in Haxe is dox. That’s what http://api.openfl.org/, https://api.haxe.org/, http://api.haxeflixel.com/ etc all use.

You can add -xml to your project to generate XML during a build

openfl build html5 -xml

You can then use that generated XML (I think it generates “types.xml” in your output directory, based on the target you use) with Dox, haxedoc or another documentation tool :slight_smile:

I try to use

haxe -xml docs/doc.xml -D doc-gen

but

C:\Users\users\openfl_projects\demo>haxe -xml docs/doc.xml -D doc-gen
Haxe Compiler 3.4.4 - (C)2005-2017 Haxe Foundation
 Usage : haxe.exe -main <class> [-swf|-js|-neko|-php|-cpp|-cppia|-as3|-cs|-java|-python|-hl|-lua] <output> [options]
 Options :
  -cp <path> : add a directory to find source files
  -js <file> : compile code to JavaScript file
  -lua <file> : compile code to Lua file
  -swf <file> : compile code to Flash SWF file
  -as3 <directory> : generate AS3 code into target directory
  -neko <file> : compile code to Neko Binary
  -php <directory> : generate PHP code into target directory
  -cpp <directory> : generate C++ code into target directory
  -cppia <file> : generate Cppia code into target file
  -cs <directory> : generate C# code into target directory
  -java <directory> : generate Java code into target directory
  -python <file> : generate Python code as target file
  -hl <file> : compile HL code as target file
  -xml <file> : generate XML types description
  -main <class> : select startup class
  -lib <library[:version]> : use a haxelib library
  -D <var[=value]> : define a conditional compilation flag
  -v : turn on verbose mode
  -debug : add debug information to the compiled code
  -help : show extended help information
  --help : show extended help information
  --help-defines : print help for all compiler specific defines
  --help-metas : print help for all compiler metadatas
  <dot-path> : compile the module specified by dot-path

Please use -xml while running openfl build or openfl test to generate XML for documentation generation. That’s step 1.

Step 2 is to pass the XML to a documentation generator, such as dox or haxedoc

Thanks it work for me.

1 Like