Skip to content

Instantly share code, notes, and snippets.

@topherhunt
Created April 17, 2019 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topherhunt/cd2d6e6b676c816e4d5026e8ca42e762 to your computer and use it in GitHub Desktop.
Save topherhunt/cd2d6e6b676c816e4d5026e8ca42e762 to your computer and use it in GitHub Desktop.
# Rid your codebase of haml templates.
# Requires Calliope as a dependency in your Mix project.
# Usage: `mix run haml.exs path/to/my/haml/file.html.haml
# It will spit out the produced eex, which you can copy & paste into place.
path = System.argv() |> Enum.at(0)
{:ok, haml} = File.read(path)
IO.puts ""
IO.puts Calliope.render(haml)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment