ECMAScript icon indicating copy to clipboard operation
ECMAScript copied to clipboard

API Documentation

Open averagehat opened this issue 4 years ago • 3 comments

As far as I can tell there is no easily accessible API documentation outside of the source code.

However, the typescript declaration file has most functions documented in addition to its types.

I suggest using typedoc to generate documentation. Users can do this themselves or this can be hosted online for free. An example: https://funkia.github.io/hareactive/

This command worked for me:

typedoc —out godot-ts-doc ./godot.d.ts  —ignoreCompilerErrors —module commonjs —target es6 —includeDeclarations ./godot.d.ts 

Additionally, I am available to help with documentation beyond this. This is a high-quality project and I would like to help it be as visible and accessible as possible.

averagehat avatar Sep 24 '20 00:09 averagehat

I dont think documentation is needed. You can use gdscript's documentation, you'll have the same info. the only thing that needs to be documented is stuff you dont find elsewhere (like how to register a signal, or typescript's decorators).

linkpy avatar Sep 24 '20 20:09 linkpy

Probably a good idea to have a docs page - not everyone likes to read source code for api usage.

To be honest, it would be better to have a "Javascript" section in godot's docs (like https://docs.godotengine.org/en/stable/tutorials/gui/gui_skinning.html should have a Javascript code tab), but since this isn't integrated into godot, typedoc is a decent alternative.

I generated typedoc docs and published to github pages in my fork here: https://flux159.github.io/ECMAScript/ See https://flux159.github.io/ECMAScript/modules/godot_d.godot.html for an example of the godot module.

The code itself isn't much - https://github.com/GodotExplorer/ECMAScript/compare/master...Flux159:docs , but it should probably be built as part of the Continuous Integration workflow.

This is more for @Geequlim to decide though. I can publish the changes as a pull request if they think it makes sense.

Flux159 avatar Sep 30 '20 01:09 Flux159

@Flux159 That looks cool. PR welcomed :P

Geequlim avatar Oct 05 '20 11:10 Geequlim