Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Rebuild documentation #10

Closed
arthuro555 opened this issue Jan 12, 2020 · 9 comments
Closed

Rebuild documentation #10

arthuro555 opened this issue Jan 12, 2020 · 9 comments

Comments

@arthuro555
Copy link

Could you please regenerate the documentation to integrate the new JSDoc? And also it would be cool to have a CI that rebuilds it for each commit 👀

@4ian
Copy link
Owner

4ian commented Jan 12, 2020

Yes yes I was thinking about this, will rebuild it :)

@4ian 4ian closed this as completed Jan 12, 2020
@4ian 4ian reopened this Jan 12, 2020
@4ian
Copy link
Owner

4ian commented Jan 12, 2020

@arthuro555 Unfortunately, the usage of & in the types of JSDoc breaks JSDoc generation :/

@arthuro555
Copy link
Author

Ok, we need to use typescript to inherit then I guess. But this is weird as this is part of the syntax.

@arthuro555
Copy link
Author

What do you use to generate the jsdoc so I can do tests?

@4ian
Copy link
Owner

4ian commented Jan 12, 2020

JSDoc is not following Typescript annotations: microsoft/TypeScript#20077 (comment)

It's following Google Closure Compiler types and won't support intersection types: jsdoc/jsdoc#1285 (comment)

Fortunately, someone made a plugin for us to use: https://github.com/chriseaton/jsdoc-plugin-intersection

Also seems like adding @type to all members made them appear in JSDoc. I used another plugin jsdoc-autoprivate to mark them automatically as private because adding @Private everywhere will really impact badly the source readability. We've been lucky to have these two plugins 🙏

What do you use to generate the jsdoc so I can do tests?

See GDevelop/scripts/GenerateAllDocs.sh - either Doxygen for C++ or jsdoc with a few parameters for GDJS:
jsdoc -c docs/jsdoc.conf.json -t docs/jaguarjs-jsdoc docs/DocMainPage.md

@4ian
Copy link
Owner

4ian commented Jan 13, 2020

Alright it works!

https://docs.gdevelop-app.com
https://docs.gdevelop-app.com/GDJS%20Runtime%20Documentation/index.html

There is a cron to trigger a build with CircleCI every few hours. This took me a large part of the evening to fight with CircleCI to get this working but this is now done.

There is a bit of cleaning to do and would be a good idea to organize classes a bit maybe, I've not checked but I guess there is way to do that in JSDoc options/templates/annotations :)
This means we have to be a bit careful when using type annotations, some might not be supported by JSDoc unfortunately.

I'll see to add to the CI tests in GDevelop a run of the documentation generator to be sure we're not breaking it.

@arthuro555
Copy link
Author

Wow, you managed to do it? Amazing! And you also made an hourly build? Just wow.

@arthuro555
Copy link
Author

Documentation is 404 @4ian

@4ian
Copy link
Owner

4ian commented Jan 13, 2020

Oops, forgot a file that got erased when publishing. Fixed now!

@4ian 4ian closed this as completed Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants