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

Add action to check for and generate missing documentation #1728

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

samsinsane
Copy link
Member

  • Added auto-generated documentation files for APIs without docs
  • Renamed editAndContinue.md to editandcontinue.md to match convention

What does this PR do?

Adds a helpful action for the Premake project to auto-generate new documentation.

How does this PR change Premake's behavior?

Prevents CI builds from succeeding if documentation is missing.

Anything else we should know?

Under certain conditions the git commands won't work, for example if a user hasn't allowed tags to be downloaded. This PR doesn't necessarily focus on a single fix/feature as the template required for missing documentation needs to be reviewed. Similarly, editAndContinue needed to be corrected to avoid a false-positive on the missing documentation.

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

premake5.lua Outdated Show resolved Hide resolved
@KyrietS
Copy link
Member

KyrietS commented Oct 4, 2021

Just remember that those auto-generated drafts won't appear on the sidebar but will still be searchable.

Sidebar auto-generation (which I've been talking about for months and it's still work-in-progress 😅) is based on folders. So eventually we would like to get something similar to 6.x docs arranged in folders. For now it is ok to have all markdown files in one folder, but I plan to change that at some point.

@samsinsane
Copy link
Member Author

Just remember that those auto-generated drafts won't appear on the sidebar but will still be searchable.

Oh, that was not intentional at all - even though I modified the sidebar.js it didn't even occur to me to add these new files. Should I add these files? I think even just availability information being there is better than nothing. @KyrietS what are your thoughts?

@KyrietS
Copy link
Member

KyrietS commented Oct 5, 2021

I think that these drafts should be listed in the sidebar so that users can see it and (hopefully) help us develop the documentation. I'm just wondering that maybe we should create a separate section in the sidebar for auto-generated pages to keep track of them 🤔.

(And personally, I wouldn't bother to automate the process of adding these pages to the sidebar)

Also, I think it would be nice if each draft had some sort of encouragement for the reader to help with the documentation improvements. "This page was auto-generated. Feel free to help us improve the documentation by creating a pull request." or something like that.

@samsinsane samsinsane force-pushed the ssurtees/docsCheck branch 2 times, most recently from 4c0c446 to d8da037 Compare October 7, 2021 08:54
@samsinsane
Copy link
Member Author

@KyrietS I've added the encouragement as you requested, and I've (manually) added the new files to the sidebar.

@samsinsane samsinsane force-pushed the ssurtees/docsCheck branch 2 times, most recently from 4f83478 to 940f524 Compare October 7, 2021 09:54
@KyrietS
Copy link
Member

KyrietS commented Oct 7, 2021

Looks like Docusaurus is complaining about anotherpage.md. That's sad. It's a bug to me so I've created an issue for this: facebook/docusaurus#5659. Let's wait for their response. In general this commit looks good to me.

@samsinsane
Copy link
Member Author

@KyrietS I can just remove the commented out section for the files that I added, and just leave it in the template generation?

@KyrietS
Copy link
Member

KyrietS commented Oct 8, 2021

@samsinsane Okay, then please do it. Their fix will be for the next version of Docusaurus anyway.

@samsinsane
Copy link
Member Author

@KyrietS I've removed the commented out section in the files this PR adds. Should be all good now! 😄

premake5.lua Outdated Show resolved Hide resolved
Copy link
Member

@starkos starkos left a comment

Choose a reason for hiding this comment

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

Very cool. Couple of thoughts:

  • Could we break this out to its own file under scripts/ and include it in, rather than embedding it inline into premake5.lua? See scripts/embed.lua as an example. I'd prefer to keep the main project file clean so it doesn't become overwhelming.
  • Is this something we want to keep around, or just run once & done? Ideally we wouldn't accept new PRs that don't include at least basic documentation for new code? I'm wondering if the PR should be just the placeholder pages for the missing APIs (as generated by this script), and then a CI check to fail if we find undocumented fields?

premake5.lua Outdated
local docfilepath = "website/docs/" .. k .. ".md"
local exists = os.isfile(docfilepath)
if not exists then
print("Genearting documenetation file for: ", k)
Copy link
Member

Choose a reason for hiding this comment

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

Typo, should be "Generating documentation file for:"

@starkos starkos changed the title Added action to Premake scripts to check for and generate missing documentation Add action to check for and generate missing documentation Oct 19, 2021
Copy link
Member

@nickclark2016 nickclark2016 left a comment

Choose a reason for hiding this comment

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

Agree with @starkos's comment. Other than that, I'm a happy camper. Huge thanks for doing this.

- Added auto-generated documentation files for APIs without docs
- Renamed editAndContinue.md to editandcontinue.md to match convention
@starkos starkos merged commit 6c9fda8 into premake:master Oct 21, 2021
@samsinsane samsinsane deleted the ssurtees/docsCheck branch October 22, 2021 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants