Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calliope chokes on functions that take a block. #64

Closed
Qqwy opened this issue May 21, 2016 · 2 comments
Closed

Calliope chokes on functions that take a block. #64

Qqwy opened this issue May 21, 2016 · 2 comments

Comments

@Qqwy
Copy link

Qqwy commented May 21, 2016

(This was first posted on the (phoenix_haml github project](chrismccord/phoenix_haml#35), and there I was guided here)

First and foremost: How nice that there is a HAML-parser for Elixir! :-)

I have this file (saved as templates/layout/menu.html.haml)

%nav.ui.top.fixed.menu
  .header.item
    Cyclicash
  .right.menu
    =link to: login_path, class: "item" do
      login

    = link to: register_path, class: "item" do
      register

link is a phoenix_html function that optionally takes a do: block as parameter. This way, in EEx, you can embed more complex html in your links.

However, this breaks the Calliope's HAML-parsing. Here is the stacktrace:

== Compilation error on file web/views/layout_view.ex ==
** (EEx.SyntaxError) web/templates/layout/menu.html.haml:11: unexpected end of string, expected a closing '<% end %>'
    (eex) lib/eex/compiler.ex:68: EEx.Compiler.generate_buffer/4
    (eex) lib/eex/compiler.ex:41: EEx.Compiler.generate_buffer/4
    (phoenix) lib/phoenix/template.ex:321: Phoenix.Template.compile/2
    (phoenix) lib/phoenix/template.ex:154: Phoenix.Template."-MACRO-__before_compile__/2-fun-0-"/3
    (elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix) expanding macro: Phoenix.Template.__before_compile__/1
    web/views/layout_view.ex:1: Heads.LayoutView (module)
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8

I think it chokes on the optional block-passing.

@smpallen99
Copy link
Collaborator

Yes, not supported at this time. You might try adding an explicit - end. Of course, pull requests are welcome :)

Sent from my iPhone

On May 21, 2016, at 3:41 PM, Qqwy notifications@github.com wrote:

(This was first posted on the (phoenix_haml github project](chrismccord/phoenix_haml#35), and there I was guided here)

First and foremost: How nice that there is a HAML-parser for Elixir! :-)

I have this file (saved as templates/layout/menu.html.haml)

%nav.ui.top.fixed.menu
.header.item
Cyclicash
.right.menu
=link to: login_path, class: "item" do
login

= link to: register_path, class: "item" do
  register

link is a phoenix_html function that optionally takes a do: block as parameter. This way, in EEx, you can embed more complex html in your links.

However, this breaks the Calliope's HAML-parsing. Here is the stacktrace:

== Compilation error on file web/views/layout_view.ex ==
** (EEx.SyntaxError) web/templates/layout/menu.html.haml:11: unexpected end of string, expected a closing '<% end %>'
(eex) lib/eex/compiler.ex:68: EEx.Compiler.generate_buffer/4
(eex) lib/eex/compiler.ex:41: EEx.Compiler.generate_buffer/4
(phoenix) lib/phoenix/template.ex:321: Phoenix.Template.compile/2
(phoenix) lib/phoenix/template.ex:154: Phoenix.Template."-MACRO-before_compile/2-fun-0-"/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix) expanding macro: Phoenix.Template.before_compile/1
web/views/layout_view.ex:1: Heads.LayoutView (module)
(elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8
I think it chokes on the optional block-passing.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@Qqwy
Copy link
Author

Qqwy commented May 25, 2016

Thank you!

I will use - end for now, and maybe create a pull-request once I understand the Calliope source.

It would be great if a note about this could be added to the readme, to prevent confusion of other people facing the same issue in the future.

mkasztelnik added a commit to mkasztelnik/calliope that referenced this issue Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants