However, this approach feels hacky and could break at any moment. My question is: Are there plans to extract the Elixir formatter into its own Hex package with a proper public API?
I don’t think the formatter will ever become an external package, because that would mean elixir itself can no longer use it. Elixir using it was one of the primary reasons for its creation though.
Can you elaborate on what exactly you mean by “this approach”?
Sure. I basically have the project linked above checked out on my computer. I then symlink all my HTML files to the lib folder and then run mix format on them. Please don’t judge me
Tbh I’m not sure how this could “break at any moment”. You’re using the formatter like it’s intended. The only specialty is the usage of symlinks, which is a really common way to handle files. I also wouldn’t expect that part to cause any breakage.