Giter Site home page Giter Site logo

Filename about slim HOT 6 CLOSED

slim-template avatar slim-template commented on May 18, 2024
Filename

from slim.

Comments (6)

judofyr avatar judofyr commented on May 18, 2024

It does?

t = Slim::Template.new('test.slim')
t.render

from slim.

minad avatar minad commented on May 18, 2024

ok, yes but I want something like that to work:

Slim::Engine.new("String", :filename => filename).render

Maybe we should also think about the api. Using Slim::Engine.new("code") for code and Slim::Template.new("file") for files isn't such a good idea.

What do you think?

from slim.

judofyr avatar judofyr commented on May 18, 2024

I don't think we should support Slim::Engine.new(code); the reason I added it was mostly because of compatibility. The "right" way to support it in Tilt is Slim::Template.new(file) and Slim::Template.new { code }.

Anyway, I believe that Slim::Template should be a part of the public API, while Slim::Engine should only be a "private" class.

from slim.

minad avatar minad commented on May 18, 2024

Yes, I agree. Does tilt support a filename option in the engine?

Slim::Template.new(:filename => ...) { code}

from slim.

judofyr avatar judofyr commented on May 18, 2024

Kinda: any string argument is automatically set as filename. So Slim::Template.new(file) { code } works. Same does Slim::Template.new(file, options) { code }.

from slim.

minad avatar minad commented on May 18, 2024

Ah, thx for the clarification.

from slim.

Related Issues (20)

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.