polymod
polymod copied to clipboard
Support automatic (or automatable) documentation of Mod API
The "Mod API" for any game/app consists of:
- The files in the asset manifest that have not been blacklisted
- Classes, member variables, and function calls whose surface area is exposed to scripts
Steps?
- [ ] Dump the asset manifest, sans blacklist (use final resolved filenames, not whatever's actually on disk, basically use the same virtual filenames as polymod will reference them)
- [ ] Look for classes that implement HScriptable
- [ ] Flag every scriptable function as shown to dox
- [ ] Flag every non-scriptable function as hidden to dox, UNLESS it's been exposed to a scriptable function, e.g.
@:hscript(Std,Math,someFunction,someOtherFunction)
- [ ] Compile project with -xml
- [ ] Run dox on the xml
- [ ] Confirm that only the moddable surface area is documented
- [ ] Confirm that ALL of the moddable surface area is documented
Here's some further thoughts about how to do it:
- Only flag functions as visible/invisible to dox if both -xml and a custom flag we set (-modapi?) is set.
My thoughts on this are:
- [ ] Generate a page which displays a manifest of default assets, with support for a deny list to hide assets you don't want to show in the generated list. Use the filenames that Polymod will see and use, not those that are on the file system (so for Lime, use the provided library path).
- [ ] Generate a page with displays the method signature and HaxeDocs for each function annotated with
@:hscript
, in files corresponding to each class implementingHScriptable
.- [ ] Under each function, provide a list of all constants that are provided to the script.
- [ ] Potentially add the ability to add links for certain constants or packages? For example make classes in the
flixel
package link to the dox at https://api.haxeflixel.com/flixel/
- [ ] Add a
@:hscript({generateDocs: false})
to disable documentation generation on scriptable functions. - [ ] Figure out how to run dox properly on the above.