I became interested in formatting
```elm code blocks inside markdown files and my first approach to this was to tweak
atom-beautify: https://github.com/Glavin001/atom-beautify/pull/1990. The PR is still waiting to be merged, but I’m generally happy with the solution locally even despite two issues described in https://github.com/avh4/elm-format/issues/65#issuecomment-353570877.
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-format via unified Prettier API from anywhere. In addition to that, the docs mention something called
embed, which possibly means that
elm-format can be applied to markdown code blocks that start with
I’m starting this topic because I have not yet found an npm package called
prettier-plugin-elm and would like to help with putting it together. 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?