Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upElm-format as prettier plugin? #459
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ohanhi
Feb 13, 2018
From what I can tell, Prettier plugins need to be JavaScript. elm-format is written in Haskell. I don't know if you can somehow write a middle layer that could make the elm-format binary to work as a Prettier plugin parser, but surely it would not be easy. I'm not saying it's not a good idea, just that it might not be as straightforward as one might think.
ohanhi
commented
Feb 13, 2018
|
From what I can tell, Prettier plugins need to be JavaScript. elm-format is written in Haskell. I don't know if you can somehow write a middle layer that could make the elm-format binary to work as a Prettier plugin parser, but surely it would not be easy. I'm not saying it's not a good idea, just that it might not be as straightforward as one might think. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kachkaev
Feb 13, 2018
Thanks for your comment @ohanhi, you're right!
I just discovered https://discourse.elm-lang.org/ and am tending to move this discussion there. Will share a link once I'm done.
kachkaev
commented
Feb 13, 2018
|
Thanks for your comment @ohanhi, you're right! I just discovered https://discourse.elm-lang.org/ and am tending to move this discussion there. Will share a link once I'm done. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kachkaev
closed this
Feb 13, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
avh4
Feb 14, 2018
Owner
FYI, I am interested in making elm-format available as a javascript package, likely using ghcjs like what https://ellie-app.com has done for elm-compiler. If anyone is interested in working on that, please coordinate with me.
|
FYI, I am interested in making elm-format available as a javascript package, likely using ghcjs like what https://ellie-app.com has done for elm-compiler. If anyone is interested in working on that, please coordinate with me. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Glavin001
Mar 2, 2018
@kachkaev : I am developing Unibeautify (complete rewrite of Atom-Beautify) with the intention of becoming a universal code beautifier. This sounds like what you're looking for.
Unfortunately, the tool I've got is Atom-specific and only works when Remark is chosen as a beautifier for markdown (which is not so by default). Of course, the situation is far from a zero-config command-line heaven or from supporting other editors like VSCode
😅 I recently noticed that Prettier (a fast-growing opinionated code formatter) added plugin support.
Unibeautify will eventually have both Atom (rewrite of Atom-Beautify ) and VSCode (New extension: https://github.com/Unibeautify/vscode ) support. And potentially others, too, like Sublime Text ( https://github.com/Unibeautify/unibeautify-sublime ).
Unibeautify's beautifiers are similar to Atom-Beautify's design. Take a look at https://github.com/Unibeautify/beautifier-prettier and https://github.com/Unibeautify/beautifier-prettydiff and others at https://github.com/Unibeautify for example. If you are interested in adding ELM Format support to Unibeautify please let us know! /cc @szeck87
Glavin001
commented
Mar 2, 2018
|
@kachkaev : I am developing Unibeautify (complete rewrite of Atom-Beautify) with the intention of becoming a universal code beautifier. This sounds like what you're looking for.
Unibeautify will eventually have both Atom (rewrite of Atom-Beautify ) and VSCode (New extension: https://github.com/Unibeautify/vscode ) support. And potentially others, too, like Sublime Text ( https://github.com/Unibeautify/unibeautify-sublime ). Unibeautify's beautifiers are similar to Atom-Beautify's design. Take a look at https://github.com/Unibeautify/beautifier-prettier and https://github.com/Unibeautify/beautifier-prettydiff and others at https://github.com/Unibeautify for example. If you are interested in adding ELM Format support to Unibeautify please let us know! /cc @szeck87 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kachkaev
Mar 16, 2018
If anyone is interested in an integration of elm-format into Prettier, see
https://github.com/gicentre/prettier-plugin-elm
Feedback is welcome!
kachkaev
commented
Mar 16, 2018
|
If anyone is interested in an integration of elm-format into Prettier, see Feedback is welcome! |
kachkaev commentedFeb 13, 2018
•
edited
Edited 4 times
-
kachkaev
edited Feb 13, 2018 (most recent)
-
kachkaev
edited Feb 13, 2018
-
kachkaev
edited Feb 13, 2018
-
kachkaev
edited Feb 13, 2018
Hi everyone👋
I became interested in formatting
```elmcode blocks inside markdown files and my first approach to this was to tweakatom-beautify: Glavin001/atom-beautify#1990. The PR is still waiting to be merged, but I'm generally happy with the solution locally even despite two issues described in #65 (comment).Unfortunately, the tool I've got is Atom-specific and only works when Remark is chosen as a beautifier for markdown (which is not so by default). Of course, the situation is far from a zero-config command-line heaven or from supporting other editors like VSCode😅
I recently noticed that Prettier (a fast-growing opinionated code formatter) added plugin support. Potentially, that's great news for the Elm community, because it seems like it is now possible to access🎉
elm-formatvia unified Prettier API from anywhere. In addition to that, the docs mention something calledembed, which possibly means thatelm-formatcan be applied to markdown code blocks that start with```elmI'm opening this issue because I have not yet found an npm package called prettier-plugin-elm and would like to help with putting it together. Sorry that it's not as relevant to
elm-formatas other issues, but perhaps this repo is still the best place to start a discussion. There is a chance that I might find some time on implementing a prototype in the next several weeks, but I'd be keen to see a bit of support from experienced members of the Elm community.Who would like to join? What do you think of this idea in general?