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

feat: add rule doc pages #165

Closed
wants to merge 12 commits into from
Closed

feat: add rule doc pages #165

wants to merge 12 commits into from

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Aug 5, 2024

This is the rendered output of oxc-project/oxc#4715. This is just about ready to go, I just need to figure out what to do about textlint.

Copy link

netlify bot commented Aug 5, 2024

Deploy Preview for oxc-project ready!

Name Link
🔨 Latest commit 518cef8
🔍 Latest deploy log https://app.netlify.com/sites/oxc-project/deploys/66b8f3ebd0c91f000883d0f5
😎 Deploy Preview https://deploy-preview-165--oxc-project.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Boshen
Copy link
Member

Boshen commented Aug 5, 2024

This is amazing!

Boshen pushed a commit to oxc-project/oxc that referenced this pull request Aug 10, 2024
> AI-generated description because I'm lazy
### TL;DR

This PR introduces the ability to generate documentation for linter rules and adds new methods and metadata for rule fix capabilities.

To see what this looks like, please check out oxc-project/oxc-project.github.io#165.

## Screenshots
Hyperlinks to rule doc pages in auto-generated rules table
<img width="809" alt="image" src="https://github.com/user-attachments/assets/e09eb47d-e86a-4ed1-b1f9-5034f33c71a2">

Example of a docs page
<img width="1273" alt="image" src="https://github.com/user-attachments/assets/78f7e9e6-f4dd-4cc9-aebc-1cdd64b024ec">

### What changed?

- Added `RuleFixMeta` to indicate rule fix capabilities
- Introduced methods `is_none` and `is_pending` in `RuleFixMeta`
- Modified `render_markdown_table` in `RuleTableSection` to accept an optional link prefix
- Created new modules for rule documentation and HTML rendering
- Updated `print_rules` function to generate markdown for rules and detailed documentation pages

### How to test?

Run the `linter-rules` task with appropriate arguments to generate the markdown table and documentation pages.
Verify the generated files for correctness and that all metadata is correctly displayed.

### Why make this change?

To enhance the project documentation and provide clear rule fix capabilities, thereby improving the developer experience and easing the integration process.

---
@DonIsaac DonIsaac self-assigned this Aug 10, 2024
@DonIsaac DonIsaac added the documentation Improvements or additions to documentation label Aug 10, 2024
@DonIsaac DonIsaac changed the title (poc) feat: add rule doc pages feat: add rule doc pages Aug 11, 2024
@DonIsaac DonIsaac marked this pull request as ready for review August 11, 2024 17:25
@Boshen Boshen closed this Aug 12, 2024
@Boshen Boshen deleted the don/feat/rule-docs branch August 12, 2024 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants