chrismccord / phoenix_haml

Phoenix Template Engine for Haml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do now work with fresh elixir and phoenix

deemytch opened this issue · comments

$ elixir -v
Erlang/OTP 22 [erts-10.7.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Elixir 1.10.3 (compiled with Erlang/OTP 22)

When compilling in fresh just created phoenix 1.5.3 project:

New:
  phoenix_haml 0.2.3
All dependencies are up to date
==> phoenix_haml
Compiling 4 files (.ex)
warning: variable "raise_with_help" does not exist and is being expanded to "raise_with_help()", please use parentheses to remove the ambiguity or change the variable name
  lib/mix/tasks/phoenix_haml.gen.html.ex:98: Mix.Tasks.PhoenixHaml.Gen.Html.validate_args!/1

warning: variable "raise_with_help" does not exist and is being expanded to "raise_with_help()", please use parentheses to remove the ambiguity or change the variable name
  lib/mix/tasks/phoenix_haml.gen.html.ex:107: Mix.Tasks.PhoenixHaml.Gen.Html.validate_args!/1

warning: Mix.Phoenix.copy_from/5 is undefined or private. Did you mean one of:

      * copy_from/4

  lib/mix/tasks/phoenix_haml.gen.layout.ex:22: Mix.Tasks.PhoenixHaml.Gen.Layout.run/1

warning: Mix.Phoenix.attrs/1 is undefined or private
  lib/mix/tasks/phoenix_haml.gen.html.ex:39: Mix.Tasks.PhoenixHaml.Gen.Html.run/1

warning: Mix.Phoenix.copy_from/5 is undefined or private. Did you mean one of:

      * copy_from/4

Found at 2 locations:
  lib/mix/tasks/phoenix_haml.gen.html.ex:53: Mix.Tasks.PhoenixHaml.Gen.Html.run/1
  lib/mix/tasks/phoenix_haml.gen.html.ex:78: Mix.Tasks.PhoenixHaml.Gen.Html.generate_templates/1

warning: Mix.Phoenix.params/1 is undefined or private
  lib/mix/tasks/phoenix_haml.gen.html.ex:46: Mix.Tasks.PhoenixHaml.Gen.Html.run/1

Generated phoenix_haml app

Then at this layout/app.html.haml gonna be crazy:

!!!
  %title Lavka
  %link{ rel: "stylesheet", href: Routes.static_path(@conn, "/css/app.css") }
  %script{ defer: true, type: "text/javascript", src: "#{Routes.static_path(@conn, "/js/app.js")}" }
%body
  = @inner_content
== Compilation error in file lib/magazin_web/views/layout_view.ex ==
** (CalliopeException) lib/magazin_web/templates/layout/app.html.haml: Invalid attribute 'defer: true type="text/javascript" src="4{Routes.static_path(@conn, "/js/app.js")}"' on line number 4`
    lib/calliope/parser.ex:183: Calliope.Parser.raise_error/3
    lib/calliope/parser.ex:37: Calliope.Parser.parse_line/2
    lib/calliope/parser.ex:22: Calliope.Parser.parse_lines/1
    lib/calliope/parser.ex:22: Calliope.Parser.parse_lines/1
    lib/calliope/parser.ex:18: Calliope.Parser.parse/1
    lib/calliope/render.ex:7: Calliope.Render.precompile/1
    lib/phoenix_haml/engine.ex:15: PhoenixHaml.Engine.read!/1
    lib/phoenix_haml/engine.ex:9: PhoenixHaml.Engine.compile/2
    (phoenix 1.5.3) lib/phoenix/template.ex:351: Phoenix.Template.compile/3
    (phoenix 1.5.3) lib/phoenix/template.ex:166: anonymous fn/4 in Phoenix.Template."MACRO-__before_compile__"/2
    (elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix 1.5.3) expanding macro: Phoenix.Template.__before_compile__/1
    lib/magazin_web/views/layout_view.ex:1: MagazinWeb.LayoutView (module)
    (elixir 1.10.3) lib/kernel/parallel_compiler.ex:304: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

There's an error in my hand-written template and mix phoenix_haml.gen.layout don't work.