Help with dox and openfl

Hello!
I’m new to Haxe, OpenFL and dox, please be patient with me :slight_smile:

I’m trying to generate documentation with dox for a library (there is no main class).
However I’m having trouble when including OpenFL. (Several classes in my library includes OpenFL classes).

I’m using Haxe 4.0.5, OpenFL 8.9.6 and dox 1.5.0.

Here’s my hxml:

-cp src
--macro include("mylib", true)
-L openfl:8.9.6
-D doc-gen
--no-output
-xml doc/doc.xml

--next
-cmd haxelib run dox -i doc -o doc/pages -in "^mylib*"

The error msg I get:

/usr/local/lib/haxe/lib/openfl/8,9,6/src/openfl/_internal/text/TextEngine.hx:132: characters 17-29 : (t : openfl._Vector.IVector<Unknown<0>>, length : Int, fixed : Bool, array : Array<Unknown<0>>) -> openfl._Vector.FloatVector should be openfl._Vector.IVector<Float> -> openfl._Vector.FloatVector

If I remove all OpenFL dependencies I have no trouble generating docs, so I think my problem is related to OpenFL? I’ve tried including just a few OpenFL classes, eg:

import openfl.utils.Object;
import openfl.utils.Assets;

It works with only Object but not with Assets. I presume Assets uses TextEngine in some way?
Any help would be appreciated!
Thank you :slight_smile:

Here’s my working dox hxml for Feathers UI:

It took me a bit to figure out how to make dox work as expected. I tried to use the include macro, like they suggest in the instructions, but it never seemed to work. I ended up finding this ImportAll class (from the official Haxe repo, I think) that worked better:

1 Like

Thank you so much! This worked :smile:

1 Like

I think there’s no need to do this manually with a hxml actually, the lime command has a -xml flag. That’s what Flixel uses.

2 Likes

Finally got around to trying this -xml flag to generate the documentation. Works great! Thanks.

Is there any way I can use dox command to generate document only for the package I want. Right now it creates a huge xml also including a lot of Classes and Functions that I don’t want. I usually don’t have more than 10-15 classes in my projects. The documents generated by dox becomes overwhelming.

I use the include macro to generate documentation for Feathers UI. Here’s what I added to my project.xml:

<haxeflag name="--macro" value="include('feathers')"/>
1 Like

dox has a --toplevel-package argument, as well as --include. See here or haxelib run dox --help.

1 Like