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

docs: show red underlines in examples in rules docs #273

Merged
merged 8 commits into from
Feb 5, 2024

Conversation

ota-meshi
Copy link
Member

Description

This PR implements ShikijiTransformer to indicate with a red marker where an error occurs in the example rules document.

Example:
image

Linked Issues

None.

Additional context

I would like to hear your opinion on displaying markers in documents.

This is my first time implementing ShikijiTransformer, so I'm still not sure if this PR will work.

I have submitted a PR to ESLint that does something similar.
eslint/eslint#18041

I would like to hear your opinion on the marker style.

Copy link

netlify bot commented Jan 29, 2024

Deploy Preview for eslint-stylistic ready!

Name Link
🔨 Latest commit d164a22
🔍 Latest deploy log https://app.netlify.com/sites/eslint-stylistic/deploys/65c10787ca4b220009665255
😎 Deploy Preview https://deploy-preview-273--eslint-stylistic.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.

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0f807a1) 99.79% compared to head (d164a22) 99.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #273   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         114      114           
  Lines       26699    26699           
  Branches     4490     4490           
=======================================
  Hits        26645    26645           
  Misses         54       54           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antfu
Copy link
Member

antfu commented Jan 29, 2024

Very cool! 🔥

@@ -4,23 +4,24 @@
"private": true,
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:build": "cd .. && pnpm run build && cd docs && vitepress build",
Copy link
Member Author

Choose a reason for hiding this comment

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

I modified the script so that it can be built with Netlify. There may be a better way than that.

@antfu
Copy link
Member

antfu commented Jan 29, 2024

That's a very interesting idea and I think it's even deserved to be a general transformer/integration similar to TwoSlash - where it could be possible to us as a part of tests as well. I'll think about the design a bit

@antfu
Copy link
Member

antfu commented Feb 5, 2024

Made a few changes to Shiki core to make this easier, and now we have:

image

Again, thanks for the amazing idea!

Do you expect to use this in the docs of your other plugins? If so, we could make a package for it.

@antfu antfu enabled auto-merge February 5, 2024 16:08
@antfu antfu added this pull request to the merge queue Feb 5, 2024
Merged via the queue into eslint-stylistic:main with commit a4296ea Feb 5, 2024
13 checks passed
@ota-meshi ota-meshi deleted the shiki-eslintmark branch February 19, 2024 00:46
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