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

Format code blocks in comments with Prettier #480

Closed
sindresorhus opened this issue Jun 7, 2017 · 7 comments
Closed

Format code blocks in comments with Prettier #480

sindresorhus opened this issue Jun 7, 2017 · 7 comments

Comments

@sindresorhus
Copy link
Member

I often get comments on my repos with some example code from a user and the code is close to unreadable because of bad formatting. Would be nice to have Prettier run on JS code blocks in comments.

Not entirely sure how we can have it syntax highlighted again after the formatting though.

@hkdobrev
Copy link
Contributor

hkdobrev commented Jun 7, 2017

Do you think this is more suitable as a separate extension? I think it would need to use not only Prettier, but then its own code highlighting tool.

@fregante
Copy link
Member

fregante commented Jun 7, 2017

I agree with @hkdobrev; prettier is 360KB, more than double RGH.

It would be nice as its own thing though. Perhaps even as a (zeit/now-based) bot which edits the comments automatically on the repos you own (a tad more effort)

@sindresorhus
Copy link
Member Author

I really like the idea of doing a bot instead. It would work even for people not using Refined GitHub and syntax highlighting would just work as normal without any extra work. Someone please do this!

@jgierer12
Copy link
Contributor

Check out https://github.com/jgierer12/prettier-github

@fregante
Copy link
Member

fregante commented Jun 14, 2017

Excellent! I love the preservation of the original as well!

I opened a couple issues jgierer12/prettier-github#6 + jgierer12/prettier-github#7

@busches
Copy link
Member

busches commented Jun 28, 2017

Is there still interest in adding this to Refined Github? Having it separate seems to be the way to go.

@fregante
Copy link
Member

fregante commented Jun 28, 2017

The GitHub app works well for me, although it needs to be enabled by the repos/org's owner. I'd rather not have it inside Refined GitHub, but I wouldn't mind having it as an extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants