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

Rework trait and weapon docs page generation #19948

Merged
merged 5 commits into from Sep 2, 2022

Conversation

penev92
Copy link
Member

@penev92 penev92 commented Mar 10, 2022

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.

  • The first commit is a straight up improvement of the current code and needs to get in no matter what.
    - 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/

@penev92 penev92 force-pushed the betterDocs branch 3 times, most recently from e00a9d6 to e3b228f Compare March 11, 2022 14:18
RoosterDragon
RoosterDragon previously approved these changes Mar 11, 2022
@penev92
Copy link
Member Author

penev92 commented Mar 11, 2022

Fixed a couple more small nits plus the above comment.
Also updated the PR description.

packaging/docs-weapons.py Outdated Show resolved Hide resolved
packaging/docs-weapons.py Outdated Show resolved Hide resolved
packaging/docs-weapons.py Outdated Show resolved Hide resolved
packaging/docs-weapons.py Outdated Show resolved Hide resolved
packaging/docs-weapons.py Outdated Show resolved Hide resolved
packaging/docs-weapons.py Outdated Show resolved Hide resolved
RoosterDragon
RoosterDragon previously approved these changes Mar 12, 2022
@penev92
Copy link
Member Author

penev92 commented Apr 15, 2022

Rebased.

@penev92 penev92 force-pushed the betterDocs branch 2 times, most recently from 3e30256 to f6977d9 Compare April 20, 2022 14:07
@penev92 penev92 changed the title Rework weapon docs page generation Rework trait and weapon docs page generation Apr 20, 2022
@penev92
Copy link
Member Author

penev92 commented Apr 20, 2022

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.
In this latest turn of events #19986 will now depend on this and will add everything sequence-related when this is merged.

@penev92
Copy link
Member Author

penev92 commented Aug 30, 2022

See, this is why we can't have nice things.

@Mailaender
Copy link
Member

It dumps source code excerpts the average moddern can't understand, and it will overflow the already quite large width of the table.

@penev92
Copy link
Member Author

penev92 commented Aug 30, 2022

The exact same thing can be said about the Type column. By the way, most of the Default Value column is empty, just taking up space and not all of the values in there are very clear either.

@Mailaender
Copy link
Member

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.

@Mailaender
Copy link
Member

You could use

hover text for example.

or

This is another hover text example with references.

but I don't know if @readthedocs supports it.

@penev92
Copy link
Member Author

penev92 commented Sep 2, 2022

After a bunch more discussion on Discord this is what I am settling on:

a "compromise" solution - don't show the extra info in the docs, "encouraging" people to get and use ORAIDE to show them the rest 😏

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.

PunkPun
PunkPun previously approved these changes Sep 2, 2022
Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@penev92
Copy link
Member Author

penev92 commented Sep 2, 2022

The final result of all the generating and transforming can be seen here:
https://docs.openra.net/en/test/dev/traits/
https://docs.openra.net/en/test/dev/weapons/

packaging/format-docs.py Outdated Show resolved Hide resolved
PunkPun
PunkPun previously approved these changes Sep 2, 2022
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.
@Mailaender
Copy link
Member

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants