slouchpie
"mix format" for html.eex and html.leex files?
Is there any mix task (or github repo) that provides formatting of html.eex and html.leex files? It seems like every text editor and IDE has its own weird solution for formatting these files so I wonder is there some ubiquitous tool for formatting these files?
Most Liked
slouchpie
Writing this for posterity:
Currently I do it using the Ruby Gem htmlbeautifier (thanks @Kurisu) .
To setup:
Install ruby with:
$ asdf plugin-add ruby
$ asdf install ruby 3.0.0-dev
$ asdf global ruby 3.0.0-dev
Open a new shell and:
$ gem install html beautifier
Then to format at any time, do something like this:
$ find lib -name "*.html.*eex" | xargs ~/.asdf/installs/ruby/3.0.0-dev/bin/htmlbeautifier
3
Kurisu
Hello I’m using this one (vscode-eex-format). But it requires to have ruby and its gem " htmlbeautifier" installed to work.
For the job it does I think it’s worth it.
2
Popular in Questions
can someone please explain to me how Enum.reduce works with maps
New
I have followed this StackOverflow post to install the specific version of Erlang.
And When I am running mix ecto.setup then getting fol...
New
Hello,
I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these
buyer = %{
id: ...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
Background
Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217
Let’s say I have a map with required and optional k...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Other popular topics
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
I have followed this StackOverflow post to install the specific version of Erlang.
And When I am running mix ecto.setup then getting fol...
New
As a follow up to my earlier question:
I have the code compiling and running but not getting a successful login from the rest server. ...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New








