-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate API Documentation, like TypeDoc #1
Comments
I'm also seeing some generated HTML docs at http://phetsims.github.io/scenery/doc/. Tagging @jonathanolson so he is aware of this issue. |
Dot has a more complete rendered API docs example: http://phetsims.github.io/dot/doc/#dimension2 |
I think TypeDoc is a great way to make our documentation more readable and accessible for the future, but I'm not sure it solves a type hierarchy tree/ diagram as @pixelzoom had mentioned in phetsims/scenery#1464. It definitely helps but it doesn't seem to provide a full overview of the hierarchy structure... perhaps that's enough though? |
I agree that the API docs discussed here (while they show some aspects of hierarchy and composition) are not as clear as manually designed diagrams like https://github.com/phetsims/scenery/blob/master/doc/layout-implementation-notes.md |
Imo this is totally unncessary at the moment. And we've gone way off in the weeds on phetsims/scenery#1464. |
I wonder if the proposal for mixin type declarations in phetsims/chipper#1356 would help with TypeDoc generation for them? |
After the changes in phetsims/tasks#1132, this command And here is a mixin from scenery: |
In phetsims/scenery#1464, @marlitas and I discussed writing and generating diagrams to depict the codebase. @pixelzoom expressed the concern that manually created diagrams could get out of date easily. @marlitas and I looked at using WebStorm to automatically (or with minimal manual effort) generate diagrams, and we also discussed automatically generating HTML documentation, which can show things like type hierarchy, composition, etc. And since it is more automatic, it may be easier to keep in sync (though would not replace well-designed and maintained diagrams).
I opened this issue here since built HTML documentation is a build artifact that will depend on multiple repos, and we may wish to version it like we version distributable JS files.
@marlitas and I looked at the spec https://tsdoc.org/ and one tool for generating docs: https://typedoc.org/. We tried rendering the docs for scenery and it did pretty well with type hierarchies and type parameters:
But not so good at mixins (but it says if you use idiomatic mixins it will support that TypeStrong/typedoc#979 )
In experimentation, I also found a way to get scenery docs to link to e.g., axon docs. Here is an example from scenery Node docs:
It correctly links to axon typedoc. This HTML documentation was generated using:
After I had adjusted axon/main like so:
I'm also seeing prior attempts at JSDoc-style HTML doc generation in:
phetsims/chipper#411
phetsims/scenery#499
Also note that for PhET-iO, we transpile TS=>JS then run jsdoc on the transpiled code to generate those docs. Generating type-aware docs for that step would be even better. Tagging @zepumph since he has overlapped with this part.
This also relates to the POSE grant and our open source ecosystem since publicly available code documentation would be useful to the community.
The text was updated successfully, but these errors were encountered: