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

Doc structure checker #95

Merged
merged 22 commits into from
Jun 28, 2023
Merged

Doc structure checker #95

merged 22 commits into from
Jun 28, 2023

Conversation

TimXLHan
Copy link
Contributor

  • You ran the local CI checker with ./check.sh with no errors
  • You updated the OmniPaxos book (if applicable)

Issues

This PR is about omnipaxos documentation structure management.

Breaking Changes

  • Changed the docs file structure to be consistent with website.
  • Added doc updating guideline in how-to-contribute
  • Added doc structure checker script file in .github/scripts
  • Added doc structure check workflow in ci.yml

Copy link
Owner

@haraldng haraldng left a comment

Choose a reason for hiding this comment

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

Please check if it's possible to do the checks without Javascript. I'll also update the how-to-contribute.md before merging.

}

if (typeof section.path !== "string") {
throw new Error(`Invalid document structure: 'path' property for section '${key}' must be a string`);
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe the error message can also say that the path should start with docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is another checker to make sure that the file path is correct (i.e. try to open corresponding file using given path).

function checkFilePath(filePath) {
    try {
        fs.accessSync(filePath, fs.constants.F_OK);
        return true; // File exists
    } catch (error) {
        throw new Error(`File "${filePath}" does not exist`);
    }
}

.github/scripts/doc_structure_checker.js Show resolved Hide resolved
@TimXLHan
Copy link
Contributor Author

Finally turned back to js and make it only runs with github action, cause running js on local env need to add node_modules into current repo which is unnecessary.

@haraldng haraldng mentioned this pull request Jun 1, 2023
3 tasks
@haraldng
Copy link
Owner

Please also try fixing the docs action for the website. I tried to fix it but it still is not completely correct. If we cannot fix it, let's at least make sure it doesn't remove all docs.

docs/contributing/contributing.md Outdated Show resolved Hide resolved
docs/contributing/contributing.md Outdated Show resolved Hide resolved
@haraldng
Copy link
Owner

@TimXLHan please fix merge conflicts and this can be merged.

@TimXLHan
Copy link
Contributor Author

TimXLHan commented Jun 28, 2023

Conflicts resolved.

@haraldng haraldng merged commit 7a89dea into haraldng:master Jun 28, 2023
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.

2 participants