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
Rework trait and weapon docs page generation #19948
Conversation
e00a9d6
to
e3b228f
Compare
Fixed a couple more small nits plus the above comment. |
Rebased. |
3e30256
to
f6977d9
Compare
So I reworked the Python script to be able to generate documentation Markdown files for traits and weapons (and sequences) instead of having separate scripts. I also added the trait JSON generation here. |
See, this is why we can't have nice things. |
It dumps source code excerpts the average moddern can't understand, and it will overflow the already quite large width of the table. |
The exact same thing can be said about the |
That one is more important for modding. Otherwise, you would be surprised by defaults. Especially since some still contain C&C actor names and stuff. |
You could use
or
but I don't know if @readthedocs supports it. |
Also made some code cleanups in the weapon docs export code.
After a bunch more discussion on Discord this is what I am settling on:
The "extra info" being the attribute's parameters. Now only showing attribute names. Updated both example wiki pages (traits & weapons) to match the current state of the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The final result of all the generating and transforming can be seen here: |
Switched the Utility's ExtractWeaponDocsCommand output to JSON. Added a Python script to generate documentation Markdown from JSON.
Switched the Utility's ExtractTraitDocsCommand output to JSON. Updated documentation generation to use that and the new Python script to generate the Markdown file, same as the Weapon documentation.
Initially I just wanted a flag to export the weapon docs info as JSON so that the OpenRA Language Server (oraide) can use it in certain scenarios, but after a request by @pchote on Discord I landed on the current solution of switching all exports to JSON and having a Python script to generate Markdown.
- After this PR is done, I'll need to do the same thing for the traits docs. (I also have the same thing lined up for sequences documentation)There are two goals here:
P.S.: The final result is now also available on a test version of the docs site:
https://docs.openra.net/en/test/dev/traits/
https://docs.openra.net/en/test/dev/weapons/