Skip to content

Comments

feat: add rule doc pages#165

Closed
DonIsaac wants to merge 12 commits intomainfrom
don/feat/rule-docs
Closed

feat: add rule doc pages#165
DonIsaac wants to merge 12 commits intomainfrom
don/feat/rule-docs

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.

@netlify
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/website#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