background preloader

Janl/mustache.js

Janl/mustache.js
Related:  Scripting

mustache(5) -- Logic-less templates. mustache(5) Mustache Manual mustache(5) mustache - Logic-less templates. A typical Mustache template: Hello {{name}} You have just won {{value}} dollars! {{#in_ca}} Well, {{taxed_value}} dollars, after taxes. {{/in_ca}} Given the following hash: Will produce the following: Hello Chris You have just won 10000 dollars! Mustache can be used for HTML, config files, source code - anything. We call it "logic-less" because there are no if statements, else clauses, or for loops. Tags are indicated by the double mustaches. Variables The most basic tag type is the variable. All variables are HTML escaped by default. You can also use & to unescape a variable: {{& name}}. By default a variable "miss" returns an empty string. Template: * {{name}} * {{age}} * {{company}} * {{{company}}} Hash: Output: Sections Sections render blocks of text one or more times, depending on the value of the key in the current context. A section begins with a pound and ends with a slash. False Values or Empty Lists Shown. Shown. Why?

StringTemplate {{ mustache }} Logic-less templates. Available in Ruby, JavaScript, Python, Erlang, node.js, PHP, Perl, Objective-C, Java, .NET, Android, C++, Go, Lua, ooc, ActionScript, ColdFusion, Scala, Clojure, Fantom, CoffeeScript, D, Haskell, XQuery, ASP, Io, Dart, and for Haxe Works great with TextMate, Vim, Emacs, and Coda The Manual: mustache(5) and mustache(1) Demo <h1>{{header}}</h1> {{#bug}} {{/bug}} {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.

Underscore.js The jQuery UI CSS Framework – Part 1: Intro and How To Style a Button | Fbloggs Geekdom This is the first in a series of articles on the jQuery UI CSS Framework.. This is a powerful suite of CSS selectors that you can use to build web applications with a consistent UI. The main jQuery UI demo page shows you a list of UI widgets (which are still somewhat limited in scope compared to ExtJS, for example), but it doesn’t do a very good job on selling you on the benefits of designing other UI components, or components of those widgets, using the UI CSS framework. What is the jQuery UI CSS Framework? It is a set of CSS selectors that let you design your web pages to conform to the jQuery UI widgets standards. The jQuery UI CSS Framework provide semantic presentation classes to indicate the role of an element within a widget such as a header, content area, or clickable region. (from the jQuery UI Theming documentation page). Benefits of the jQuery UI CSS Framework Here are the top benefits I think the framework has to offer: It handles difficult design issues for you. Next Article

A Lean and Mean Un-opinionated Templating Engine - CodeProject Download Clifton.Core.TemplateEngine.zip - 89.4 KB Table of Contents Introductory Rant I've fussed with the templating engine RazorEngine in conjunction with Microsoft's Razor parser and code generator and every time I fuss with it, I spend far too much time getting the NuGet dependencies working correctly, and I've never been able to get the whole ApplicationDomain thing working correctly so that I don't end up with hundreds of temporary assembly files in my bin folder. So I'm presenting you with a lean and mean template parser that simply gets the job done. Goals Simple - Let's try to write this in under 500 lines of code. Requirements We should be able to apply template parsing to any kind of text document, not just HTML. Code Blocks A code block always begins with @{ and always ends with a matching }. Literal Copy With a Code Block Inside a code block, a line of text can be copied literally using the @: syntax, for example: Hide Copy Code @: Do not interpret me as code. Variable Replacement

repeatingbeats/invoke - GitHub Prototype v1.7.1 API documentation | Home An object-oriented JavaScript framework Prototype is a JavaScript framework that aims to ease development of dynamic web applications. It offers a familiar class-style OO framework, extensive Ajax support, higher-order programming constructs, and easy DOM manipulation. Targeted platforms Prototype currently targets the following platforms: Microsoft Internet Explorer for Windows, version 6.0 and higherMozilla Firefox 1.5 and higherApple Safari 2.0.4 and higherOpera 9.25 and higherChrome 1.0 and higher Using Prototype To use Prototype in your application, download the latest release from the Prototype web site ( and copy dist/prototype.js to a suitable location. Building Prototype from source prototype.js is a composite file generated from many source files in the src/ directory. From the root Prototype directory, Contributing to Prototype Check out the Prototype source with Find out how to contribute: Documentation

Updating PhoneGap's ChildBrowser plugin to handle local files Recently, I have been working on an iPad sales tool application with Shawn Crowley and Marissa Christy. We are using a framework called PhoneGap to build the application. PhoneGap allows us to write the majority of the app using HTML and JavaScript. HTML and JavaScript have been excellent for 95% of the application, but these two features are more cleanly implemented using the built-in iOS widgets. Email SupportPDF Display Support It turns out that our needs for this functionality are not uncommon. Matt Kane created a github project called phonegap-plugins that solves both of these problems. Thanks for the plugins Matt, they have been a great help. We used the EmailComposer plugin to solve the email support feature and the ChildBrower plugin to solve the pdf display support feature. The ChildBrowser plugin allows external webpages to be displayed within a PhoneGap application. Client JavaScript Code: Updated ChildBrowserCommand.m:

Mustache is a JavaScript template library that helps developers work with JSON objects instead of having their data source return HTML. When you make a network call to gather data from mobile devices, it's best to keep the payload, or the return data, as small as possible. JSON, or JavaScript Object Notation, is a string of characters that can be transformed into any array to pull in data. Most of the popular social networks, including Facebook, Twitter, and foursquare, and APIs, use JSON to return data.

Mustache has a lot of other features, including logic and loops that help you easily build out a list of data with a few lines of code. by indigetal Nov 29

Je test cette lib justement ! (avec node.js mais elle a l'air d'être utilisée aussi coté client.)

franchement avec un nom comme ça c'est normal qu'elle est du succés.... by simonw Nov 26

Related: