Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkh/haml-more
Adds more functionality to Haml and Sass (part of BigBand).
https://github.com/rkh/haml-more
Last synced: 18 days ago
JSON representation
Adds more functionality to Haml and Sass (part of BigBand).
- Host: GitHub
- URL: https://github.com/rkh/haml-more
- Owner: rkh
- License: ncsa
- Created: 2010-02-18T22:53:25.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-07-19T14:38:49.000Z (over 14 years ago)
- Last Synced: 2024-05-14T09:22:29.724Z (6 months ago)
- Language: Ruby
- Homepage:
- Size: 102 KB
- Stars: 19
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Haml::More and Sass::More
=========================Adds more functionality to Haml and Sass. Haml helpers detect if called from another context, so they are usable with Erb and friends.
BigBand
-------Haml::More and Sass::More are part of the [BigBand](http://github.com/rkh/big_band) stack.
Check it out if you are looking for fancy Sinatra extensions.Haml extensions
---------------* `content_for` and `yield_content` (like in Rails, you know?)
// some_file.haml
= yield_content(:foo)
.content
= haml :another_file
// another_file.haml
- content_for(:foo)
%b bar
.something
%h1 cool, huh?* adds `:coffee_script` for inline [CoffeeScript](http://jashkenas.github.com/coffee-script/)
%head
%title CoffeScript example
:coffee_script
if happy and knows_it
claps_hands()
cha_cha_cha()
%body
contentSassScript extensions
---------------------* `min` and `max`
.someClass
width = max(100px, !someSize * 3)
height = min(!a, !b, 20%)Usage with Sinatra
------------------Classic style:
require "sinatra"
require "haml/more"Modular:
require "sinatra/base"
require "haml/more"
class Foo < Sinatra::Base
helpers Haml::More
endUsage without Sinatra
---------------------Using just Sass::More (if you're in Merb or Rails):
# in some initializer or something
require "sass/more"Without anything:
require "haml/more"
scope = Object.new
scope.extend Haml::More
puts Haml::Engine.new("%p some haml code").render(scope)