Coder Social home page Coder Social logo

etlua's People

Contributors

leafo avatar leonardus avatar vain474 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

etlua's Issues

won't run in lapis application

/usr/local/share/lua/5.1/lapis/application.lua:526: attempt to call a table value
stack traceback:
Traceback

stack traceback:
  [C]: in function 'error'
  /usr/local/share/lua/5.1/lapis/application.lua:526: in function 'handler'
  /usr/local/share/lua/5.1/lapis/application.lua:338: in function 'resolve'
  /usr/local/share/lua/5.1/lapis/application.lua:347: in function </usr/local/share/lua/5.1/lapis/application.lua:345>
  [C]: in function 'xpcall'
  /usr/local/share/lua/5.1/lapis/application.lua:345: in function 'dispatch'
  /usr/local/share/lua/5.1/lapis/nginx.lua:170: in function </usr/local/share/lua/5.1/lapis/nginx.lua:168>

Get this when running

etlua = require 'etlua'

lapis.serve class extends lapis.Application

  [index: '/:slug']: capture_errors =>
    -- ... some code

    template = etlua.compile '<span><%= slug%></span>'

    -- ... some more code

in a lapis application.

This works in a console application:

etlua = require 'etlua'
template = etlua.compile '<span><%= slug%></span>'

[Feature request] Alter open/close tags to allow nesting

Re: #5

Is there a chance the syntax could be extended, following the Lua pattern of multiline strings, to something like:

[==[ variable nuimber of extensions as long as they're equal ]==]
<==% something like this or %==>
<%%% variable percents? %%%>

Not sure the optimal way, but something like that to allow nesting of templating tags.

Question: how to escape "<%" and "%>โ€œ

Hi, @leafo
When I use chart.js , it uses a legend template filed like this:

//String - A legend template
legendTemplate: '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].lineColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>',

etlua should not translate "<%" and "%>" in this string, how can I escape them?

Etlua Syntax Highlighting for Vim

I've created etlua syntax highlighting for vim.

It's available for etlua files (with HTML) and for plain text files, in case you want to template other file types.

I had a partially working one for Sublime Text as well but haven't looked at it in a while. If anyone is interested in that let me know, and I'll see if I can dig it up.

Deal with sub-template outside Lapis

I would like to understand how to deal with sub-template when we are outside of Lapis?

I had tested something like that

<!-- templates/test.etlua -->
<html>
    <% etlua.render("templates.partials.head") %>

    <body>
        Hello <%- title %>

        <%- content %>
    </body>
</html>

But it's not working ... I presume it's a package.path problem, but i don't know how to fix it.

Thanks for your help!

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.