Skip to content
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

Add documentation with Typedoc again #54

Merged
merged 47 commits into from
Apr 8, 2021
Merged

Add documentation with Typedoc again #54

merged 47 commits into from
Apr 8, 2021

Conversation

marcofugaro
Copy link
Member

@marcofugaro marcofugaro commented Nov 16, 2020

Close #12

This PR is a continuation of #14, it uses the newer beta of Typedoc being developed in TypeStrong/typedoc#1364.

Preview of the docs here

Things to fix

  • Show the class params in the class page.

Currently the class params are not being shown,

this is probably because the JSDoc @param definition is not supported in Typedoc

However they are being shown in the homepage, which is not the correct place for them

I guess this is because the type BodyOptions is exported directly?

  • Class properties and methods comments are not shown

This is because the comment are currently in line format:

They need to be in JSDoc format:

UI/UX Improvements

  • Disable the header scroll-up behaviour, it is annoying
  • Hide the All and Only exported keys, we don't use them in this project

@stockhuman
Copy link
Member

Hey @marcofugaro, I can help out with this in my spare time, and push AABB unless you had other plans. :)

@marcofugaro
Copy link
Member Author

❤️❤️
thanks @stockhuman any help is appreciated, commits 8cf2711#diff-a0a9650986b438fd092671e05a98fb560e381188460824affdf3a41a97bef0f0 and b1ff14a should help you get started.

Basically here is what you do:

  • convert // comments to /** comments for class properties
  • put static methods/properties in the class
  • remove any @method jsdoc annotation in the class methods
  • remove every jsdoc annotation except @example in the class jsdoc comment
  • move the options type in the constructor and export the type like this export type SpringOptions = ConstructorParameters<typeof Spring>[2]

In the meantime I was working on updating the examples to three 0.125 and researching a better way of doing the BufferGeometry to ConvexGeometry conversion in the branch three-update

@stockhuman
Copy link
Member

@marcofugaro Yeah - I saw b1ff14a - it's very helpful. :)

I completely missed the r125 branch; I guess the pull to fix use-cannon can wait on whatever we settle on as I quite like being able to simply pass geometries to convexPolyhedron.

@stockhuman stockhuman added the documentation Improvements or additions to documentation label Feb 15, 2021
@marcofugaro
Copy link
Member Author

🤩 amazing work @stockhuman thanks a lot!

Just an issue, could you leave out of this PR the stuff non related to JSDoc? Such as using an inline Vec3 here. I believe the Vec3 is saved outside of the class for memory reasons.

This is the diff of the stuff you did, if it's useful b1ff14a...pmndrs:0b81356

@stockhuman
Copy link
Member

I'm getting this.emitContactEvents is not a function in the examples, coming from within World. This seems to predate my changes (present in b1ff14a), but working as intended by ac7a1f2.

@stockhuman
Copy link
Member

Just an issue, could you leave out of this PR the stuff non related to JSDoc? Such as using an inline Vec3 here. I believe the Vec3 is saved outside of the class for memory reasons.

Sure thing, will undo. :)

@marcofugaro
Copy link
Member Author

Little typo at line 37 of RaycastVehicle.ts

image

@marcofugaro
Copy link
Member Author

I'm getting this.emitContactEvents is not a function in the examples, coming from within World. This seems to predate my changes (present in b1ff14a), but working as intended by ac7a1f2.

Ummm, will look into this

@stockhuman
Copy link
Member

Little typo at line 37 of RaycastVehicle.ts

image

Embarrassing, lol.

@marcofugaro
Copy link
Member Author

marcofugaro commented Feb 24, 2021

Thanks for the amazing work @stockhuman!! I'll take it from here, fix the build issue and solve conflicts in next few days.

@stockhuman
Copy link
Member

Awesome, glad I could help. :)

@marcofugaro
Copy link
Member Author

The documentation is done! 🎉

Preview: https://raw.githack.com/pmndrs/cannon-es/typedoc2/docs/index.html

Ended up enabling the excludeNotDocumented option to hide all internal stuff, but that meant adding a jsdoc comment to all methods that need to be exposed. It is done!

Only thing to fix is the build issue, it's pretty straightforward, will fix it soon.

@marcofugaro marcofugaro marked this pull request as ready for review April 8, 2021 20:55
@marcofugaro marcofugaro merged commit 081fee8 into master Apr 8, 2021
@marcofugaro marcofugaro deleted the typedoc2 branch April 8, 2021 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation website
2 participants