jmparsons / play-dustjs Goto Github PK
View Code? Open in Web Editor NEWThis sbt plugin for Play provides build time compilation for Dust templates.
This sbt plugin for Play provides build time compilation for Dust templates.
can the plugin be made to look for templates in a specific place under 'assets', or anywhere under 'assets'?
rationale: i do not want all my templates to be in the /assets/ directory, but in a dedicated place, such as /assets/templates/ or /assets/tl/ and either:
here's how i managed to get it to work the plugin with require.js. here is my experience based on the current readme (in coffeescript):
Include the core dust file in your require.config portion, and as a dependency for your app (dust can be downloaded from LinkedIn Dustjs or here):
require.config
paths:
dust: '../third/dust-full-2.3.4.min'
shim:
app:
deps: ["backbone", "dust"]
exports: "app"
require ["app"], (app) ->
$ ->
console.log("app")
Place your template .tl files into the app/assets directory.
Pull in the generated javascript template file as part of your view's required:
define ["app", "../../home"], (app) ->
class app.Views.Home extends Backbone.View
Render the template:
render: () ->
dust.render "home", model, (err, out) =>
$(@el).html(if err then err else out).data
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.