godot-extended-libraries / hydro

Hydro is a Godot Engine module which allows rigid bodies to behave realistically in water.
MIT License
62 stars 12 forks source link

Merge external wiki documentation into help browser #1

Closed fire closed 3 years ago

fire commented 3 years ago

Currently there's two places where documentation is stored, that is bad because it means duplicated work.

jonri commented 3 years ago

Is there a way to generate web-based documentation from the xml files? I imagine that's how the official godot documentation is generated, but I'm not sure the best course of action for a module. My original reasons for the duplication were:

  1. So that users could easily see if the module might suit their needs before going to the trouble to build from source
  2. Jumping to the documentation in-engine is nice, but when making heavy use of something new it can be more practical to keep the documentation in a separate window

I'll definitely roll the non-API documentation files into a proper readme, but I'd value some input on the above.

fire commented 3 years ago

Not sure. I would try asking Xrayez in the godot-extended-libraries for this feature in modules.

jonri commented 3 years ago

I ended up going down this rabbit hole myself. It turns out that github supports .rst files in the wiki, which is the format that the xml documentation gets turned into for the official online docs. I made a dedicated project to test the following workflow using Github Actions, which can automatically trigger anytime a commit changes a file in the doc_classes folder:

  1. Check out the latest version of the repo
  2. Grab the makerst.py tool from godot
  3. Convert the .xml documentation to .rst
  4. Run a sed script to fix up the links in the .rst files
  5. Upload the .rst files to the wiki

With a handwritten main page and sidebar to pull it all together, this process could meet my goals of having web-based API documentation while also eliminating the manual duplication of those files.

fire commented 3 years ago

That sounds great. Feel free to add the feature.

jonri commented 3 years ago

Here's a summary of the documentation improvements: