Comments (9)
I could go either way on this. One of my least favorite parts of Rails is all the autoloading.
But if you take that out, what does Tilt offer for Mustache users?
from tilt.
Between path
, template_extension
, template_file
, and the :namespace
option the autoloading is very configurable and simple. Maybe Tilt could provide it and the framework (Sinatra, Rails, whatev) could set up things the way it wants?
from tilt.
Yeah. Mustache is different from most template systems because the template file locating is handled so well by the view class. It seems like Tilt and Mustache make sense in the following scenarios:
- Cases where you'd use Mustache.render or a template without a specific view subclass. e.g., here's a
.html
template file and a Hash of values, render that shit. In this way, Mustache works like most other template languages. - Cases where the view and template are always side by side in the same directory or where the view is very easily locatable given the template filename.
The case where Tilt probably isn't useful/applicable is when you're writing code directly against a view subclass before rendering. If you already have the view class, tilt doesn't really help anything. I can't think of any reason to use Tilt in that case.
So, if you use Mustache in a template oriented way, Tilt makes sense. If you use Mustache in a view class oriented way (which seems to be more in the spirit of the stache), then Tilt has little to offer.
from tilt.
Or something.
from tilt.
Maybe the autoloading should be in Mustache itself. It does load template files, after all.
from tilt.
I think that makes a lot of sense. We're already doing the autoloading in sinatra and now tilt so it's safe to assume more environments will need to deal with it. Implementing in mustache would make things a bit more consistent across environments.
from tilt.
Try this on for size: http://github.com/defunkt/tilt/commit/39d137a23e19163dcbdb2783b303e4f85080260b
from tilt.
Added some cleanup, too: http://github.com/defunkt/tilt/commits/simpler_mustache_loading
from tilt.
Great patch.
from tilt.
Related Issues (20)
- SyntaxError when rendering ERB `<%=` with a block HOT 3
- Eliminate dependency on deprecated 'sass' Gem HOT 6
- HAML SASS Directive fails when passed an 8-digit hex value HOT 2
- Push tag v2.0.9 HOT 1
- How do you pass Redcarpet render options through Tilt? HOT 2
- Missing extensions for markdown when using Redcarpet HOT 4
- Pug support HOT 3
- [2.0.10 Regression] Methods defined in a template can't be used later in the template HOT 22
- Slim fails since tilt 2.0.10 HOT 1
- Uninitialized constant problem in Heroku / Sinatra HOT 3
- Test failure: TestSlimEmbeddedEngines#test_render_with_markdown HOT 1
- CVE-2020-14001 Kramdown gem version HOT 8
- Opal support outdated HOT 2
- Not support all options for CommonMarker HOT 1
- uninitialized constant Tilt::Dummy on special conditions HOT 1
- Trying to get in touch regarding a security issue HOT 2
- coffee-script is getting deprecated HOT 7
- Haml::TempleEngine: Option :line is invalid HOT 2
- Warnings when running tests with ruby 3.0 and 3.1 in Debian and Ubuntu HOT 2
- Can we have a Gem release of the current state of Tilt? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tilt.