GithubHelp home page GithubHelp logo

expug's People

Contributors

cubeguerrero avatar rstacruz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

expug's Issues

Ability to interpolate Elixir variables

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.

Existing Pug templates fail compilation after upgrade to v0.9.0

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.

Compilation error on consecutive if else blocks

This causes a compilation error:

= if true do
  p ...
= else
  p ...

= if true do
  p ...
= else
  p ...

However, these cases work:

  • Adding an extra element between if else blocks
= if true do
  p ...
= else
  p ...

span Unnecessary element

= if true do
  p ...
= else
  p ...
  • Consecutive if blocks
= if true do
  p ...

= if true do
  p ...

LiveView support

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.

error translating code from html

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

Newline with dot in attributes

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.