Refined-github: Format code blocks in comments with Prettier

Created on 7 Jun 2017  路  7Comments  路  Source: sindresorhus/refined-github

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.

Most helpful comment

All 7 comments

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.

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)

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!

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

I opened a couple issues https://github.com/jgierer12/prettier-github/issues/6 + https://github.com/jgierer12/prettier-github/issues/7

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pawelad picture pawelad  路  3Comments

Celthi picture Celthi  路  3Comments

sindresorhus picture sindresorhus  路  3Comments

vanniktech picture vanniktech  路  3Comments

Arcanemagus picture Arcanemagus  路  3Comments