-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature request: ability to format code files hosted on github #108
Comments
To be clear, do you mean a read-only display or within the file editor? |
The former should we easy as we would just need to tweak how we detect text fields and make sure the button styles are appropriate in this toolbar. I'm not sure if we can reliably do the latter, as even if we supported read-only formatting, it could interfere with GitHub features like highlighting, selections, line/range links, and comments. |
We're tracking that in #21 |
Agreed with @nickmccurdy. I don’t think it’s a good idea to format read-only content. The overhead of reverse-engineering the DOM structure to work with GitHub’s scripts would be extremely difficult, with no guarantees that it’ll work at any given time. |
I'm okay with keeping this open to track support for GitHub's file editors. |
I did some investigating and this seems less straightfoward. The file editor is CodeMirror 6 (with gist.github.com, it is CodeMirror 5). From what I know about CodeMirror 6, it tracks state changes internally (not reading DOM), so a solution may require writing an extension. But I doubt GitHub has some mechanism for customizing CodeMirror editor extensions. |
@hyperupcall I think that's just for code editors, not discussion editors, right? We could shift focus to supporting discussion editors since GitHub's VSCode based editors (replacing code editors) already support Prettier. |
When I am on GitHub in some project directory .if that's a file say index.js then by clicking on some extensions option I should get that file content rerendered with prettier formatted code
The text was updated successfully, but these errors were encountered: