Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puts the Fu in Mustache

Fu

Fu combines the logic–less portability of Mustache with the terse utility of Haml. This is what it looks like:

%ul
  {{#children}}
    %li {{name}}

Then in the (Sinatra) app:

get "/list" do
  fu :list, :locals => {:children => [{:name => "Arne"}, {:name => "Bjarne"}]}
end

And you get:

<ul><li>Arne</li><li>Bjarne</li></ul>

A contrived example using all aspects of the syntax:

%h1 Hello, {{user_name}}
%p.text
  This is a paragraph of 
  text.    
%ul.friend_list(data-attribute1="some data", data-attribute2="{{some_mustache_data}}")
  {{#friends}}
    %li
      {{>friend_partial}}
  {{^friends}}
    %p.error
      You, unfortunately, have no friends.

Usage

Fu.to_mustache("%p Hello {{mustache}}")

Sinatra w/Tilt? See https://github.com/benglerpebbles/fu-tilt#readme

Todo

  • Support /-comments

About

Fu-templates combine the logic–less portability of Mustache with the terse utility of Haml.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages