Closed arnaudgolfouse closed 3 years ago
I can only comment from a .NET perspective, but automatically generating API descriptions is definitely the way to go. The only catch here is that the code itself then should be commented with the example inputs and nice descriptions, basically everything that is in DOCUMENTATION.md
right now. And it would still be quite a mission to check these descriptions before committing any code, so that the generated descriptions are up to date.
Yeah, that is why I think using DOCUMENTATION.md
is not the best idea: I would rather directly use the output of cargo doc
in some way, as it is much easier to maintain documentation directly written in the code (dijkstra-map-gd/src/lib.rs
in this case).
Yeah, the documentation is an issue. From user perspective, the documentation should stylistically match Godot's documentation (ie. be in GDScript). That's why we originally opted to write it manually into .md file instead of using cargo doc
. Rust documentation will be rather opaque to your average godot user (speaking from experience).
Perhaps we should ask guys over at gdnative rust bindings. This seems more like a general issue for all gdnative rust users, than merely our specific problem.
You're right, it should be as easy to read as possible to Godot users... I don't think there is a canonical way to write / distribute documentation in Godot ? (except for the engine's internal documentation)
I will ask in the gdnative rust bindings repository. I don't know if they will be able to help us, but it would be amazing to have a tool to generate this documentation automatically...
Done, we will see how that goes :)
So they pointed to a way to generate this ourselves... To be honest this seems reasonably feasible, and I would gladly do it. I won't be able to work on it for the next few weeks though.
Okay multiple thoughts :
Folks, it is alive ! 🎉
I made a documentation tool here, and it is now published to crates.io, which means it is ready to be used for this project ! Some adjustments will be necessary to make it work, but you can expect a PR relatively soon 🙂
PS: This is usable in (theoretically) any godot-rust project that exports to gdscript !
Since this is now merged and exported to the asset store, I think it's fair to say this issue was resolved 😃
Hello,
I realized that
DOCUMENTATION.md
might not be up to date with the rest of the code, and in trying to update it, it became quite evident that a lot of information here is redundant withdijkstra-map-gd
's documentation. I don't think this is a great system right now, because:DOCUMENTATION.md
and the crates documentation in sync, which is a bit tedious and error proneDOCUMENTATION.md
first, but it is more likely to be out of date (because it isn't directly tied to the code) !So I wonder what we might do to improve this :
DOCUMENTATION.md
in some way. This sounds nice but I have no idea if this is even feasible in a straightforward and maintainable way.dijkstra-map
/dijkstra-map-gd
are available as far as I can tell)dijkstra-map
crate would be easy to use by other peopledijkstra-map-gd
(usingcargo doc
), and copy-paste it on the wiki as-is.I also consider here that documenting the Rust code is enough : but this is a gdnative documentation, and maybe we would need to document the bindings it produces in gdscript ? Overall I would say the best would be 3., or maybe 4., as they would allow us to simply link to the documentation in the
README.md
and carry on without thinking about it. But I wonder what you think about it ?