rstacruz / expug Goto Github PK
View Code? Open in Web Editor NEWPug templates for Elixir
Home Page: http://hexdocs.pm/expug
Pug templates for Elixir
Home Page: http://hexdocs.pm/expug
Hi.
I'm toying with using expug
for a simple LiveView app I have written, but I'm currently getting stuck trying to convert some instances of interpolation I have.
div(id="item<%= insert_id %>")
Is this currently supported, and if so, what am I doing wrong?
Great work on this.
Regards,
James.
consider:
- sum = fn (a, b) -> a + b end
- has_value = sum.(2, 3)
- is_empty = nil
p= has_value
p= is_empty
I would expect
<p>5</p>
<p></p>
instead i get
<p>
5
</p>
<p>
</p>
...which seems wrong. Is there a mode to turn off the unintended newlines?
We are encountering multiple compilation errors when attempting to compile against Expug v0.9.0 (this is with existing code that compiled successfully with v0.8.0 and earlier).
We are using:
Erlang OTP-20.1.2
Elixir 1.5.2
phoenix 1.3.0
expug 0.9.0
phoenix_expug 0.1.1
Example compile failures are:
** (Expug.Error) lib/my_app_web/templates/error/401_unauthorized.html.pug: Parse error on line 19
p If you are the application owner check the logs for more information.
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/document/new.html.pug: Parse error on line 17
em once
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/layout/_app_footer.html.pug: Parse error on line 35
em Contact:
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/document/invalid.html.pug: Parse error on line 15
li The document has been downloaded <em>previously</em>
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/document/invalid.html.pug: Parse error on line 26
li The document is no longer available
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/error/401_unauthorized.html.pug: Parse error on line 14
i.material-icons visibility_off
^
Expug encountered a character it didn't expect.
** (Expug.Error) lib/my_app_web/templates/layout/_app_footer.html.pug: Parse error on line 14
span |
^
Expug encountered a character it didn't expect.
https://github.com/nurugger07/calliope does not support partials. Does expug? I didn't see anything in the docs.
Thanks!
This causes a compilation error:
= if true do
p ...
= else
p ...
= if true do
p ...
= else
p ...
However, these cases work:
= if true do
p ...
= else
p ...
span Unnecessary element
= if true do
p ...
= else
p ...
= if true do
p ...
= if true do
p ...
Howdy!
I'm not sure how actively expug is supported/developed, but I was curious if there was any plans for Phoenix LiveView support or if I should look elsewhere?
Great work on this either way!
Regards.
Hi...I'm having troubles converting this code
<div class="poll-form">
<h2>New Poll</h2>
<%= form_for @poll, poll_path(@conn, :create), fn f -> %>
<label>
Title:<br />
<%= text_input f, :title %>
</label>
<br />
<label>
Options (separated by commas):<br />
<input type="text" name="options" />
</label>
<br />
<%= submit "Create" %>
<% end %>
</div>
basically seems that I cant add more one attribute in the input...if I add name attribute I get an error, and the br is a trouble too
.poll-form
h2 New Poll
= form_for @poll,poll_path(@conn,:create), fn f ->
label Title
= text_input f, :title
br
label Options (comma separated)
input(name="options",type="text")
= submit "create"
I get this error...
Compiling 1 file (.ex)
== Compilation error in file lib/vocial_web/views/poll_view.ex ==
** (Expug.Error) lib/vocial_web/templates/poll/new.html.pug: Parse error on line 9
input(name="options",type="text")
^
Expug encountered a character it didn't expect.
lib/expug.ex:96: Expug.to_eex!/2
(phoenix_expug) lib/phoenix_expug/engine.ex:24: PhoenixExpug.Engine.read!/1
(phoenix_expug) lib/phoenix_expug/engine.ex:18: PhoenixExpug.Engine.compile/2
(phoenix) lib/phoenix/template.ex:378: Phoenix.Template.compile/2
(phoenix) lib/phoenix/template.ex:186: anonymous fn/3 in Phoenix.Template."MACRO-__before_compile__"/2
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix) expanding macro: Phoenix.Template.__before_compile__/1
lib/vocial_web/views/poll_view.ex:1: VocialWeb.PollView (module)
(elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
what would be the issue here???
thank you
This parses improperly:
li
img(src=x.x)
But this is OK without the extra newline:
li
img(src=x.x)
It's also ok without the dot:
li
img(src=xx)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.