haml-edge 2.1.21 → 2.1.22
Sign up to get free protection for your applications and to get access to all the features.
- data/EDGE_GEM_VERSION +1 -1
- data/FAQ.md +142 -0
- data/{README.rdoc → README.md} +141 -141
- data/Rakefile +29 -17
- data/VERSION +1 -1
- data/lib/haml/buffer.rb +63 -27
- data/lib/haml/engine.rb +103 -80
- data/lib/haml/error.rb +7 -7
- data/lib/haml/exec.rb +80 -26
- data/lib/haml/filters.rb +106 -40
- data/lib/haml/helpers/action_view_extensions.rb +34 -39
- data/lib/haml/helpers/action_view_mods.rb +132 -139
- data/lib/haml/helpers.rb +207 -153
- data/lib/haml/html.rb +40 -21
- data/lib/haml/precompiler.rb +2 -0
- data/lib/haml/shared.rb +34 -3
- data/lib/haml/template/patch.rb +1 -1
- data/lib/haml/template/plugin.rb +0 -2
- data/lib/haml/template.rb +5 -0
- data/lib/haml/util.rb +136 -1
- data/lib/haml/version.rb +16 -4
- data/lib/haml.rb +502 -481
- data/lib/sass/css.rb +106 -68
- data/lib/sass/engine.rb +55 -22
- data/lib/sass/environment.rb +52 -21
- data/lib/sass/error.rb +23 -12
- data/lib/sass/files.rb +27 -0
- data/lib/sass/plugin/merb.rb +2 -2
- data/lib/sass/plugin/rails.rb +0 -2
- data/lib/sass/plugin.rb +32 -23
- data/lib/sass/repl.rb +7 -0
- data/lib/sass/script/bool.rb +9 -5
- data/lib/sass/script/color.rb +87 -1
- data/lib/sass/script/funcall.rb +23 -2
- data/lib/sass/script/functions.rb +93 -44
- data/lib/sass/script/lexer.rb +33 -3
- data/lib/sass/script/literal.rb +93 -1
- data/lib/sass/script/node.rb +14 -0
- data/lib/sass/script/number.rb +128 -4
- data/lib/sass/script/operation.rb +16 -1
- data/lib/sass/script/parser.rb +51 -21
- data/lib/sass/script/string.rb +7 -4
- data/lib/sass/script/unary_operation.rb +14 -1
- data/lib/sass/script/variable.rb +12 -1
- data/lib/sass/script.rb +26 -5
- data/lib/sass/tree/attr_node.rb +46 -9
- data/lib/sass/tree/comment_node.rb +41 -1
- data/lib/sass/tree/debug_node.rb +8 -0
- data/lib/sass/tree/directive_node.rb +20 -0
- data/lib/sass/tree/file_node.rb +12 -0
- data/lib/sass/tree/for_node.rb +15 -0
- data/lib/sass/tree/if_node.rb +22 -0
- data/lib/sass/tree/mixin_def_node.rb +12 -1
- data/lib/sass/tree/mixin_node.rb +13 -0
- data/lib/sass/tree/node.rb +136 -6
- data/lib/sass/tree/rule_node.rb +66 -7
- data/lib/sass/tree/variable_node.rb +10 -0
- data/lib/sass/tree/while_node.rb +11 -1
- data/lib/sass.rb +544 -534
- metadata +7 -6
- data/FAQ +0 -138
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-06-
|
13
|
+
date: 2009-06-07 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -24,12 +24,12 @@ executables:
|
|
24
24
|
extensions: []
|
25
25
|
|
26
26
|
extra_rdoc_files:
|
27
|
-
- FAQ
|
28
27
|
- MIT-LICENSE
|
29
|
-
- README.rdoc
|
30
28
|
- VERSION
|
31
29
|
- EDGE_GEM_VERSION
|
32
30
|
- REVISION
|
31
|
+
- FAQ.md
|
32
|
+
- README.md
|
33
33
|
files:
|
34
34
|
- rails/init.rb
|
35
35
|
- lib/haml.rb
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/sass/script/string.rb
|
78
78
|
- lib/sass/script/unary_operation.rb
|
79
79
|
- lib/sass/script/variable.rb
|
80
|
+
- lib/sass/script/node.rb
|
80
81
|
- lib/sass/tree
|
81
82
|
- lib/sass/tree/attr_node.rb
|
82
83
|
- lib/sass/tree/comment_node.rb
|
@@ -227,12 +228,12 @@ files:
|
|
227
228
|
- extra/edge_gem_watch.rb
|
228
229
|
- Rakefile
|
229
230
|
- init.rb
|
230
|
-
- FAQ
|
231
231
|
- MIT-LICENSE
|
232
|
-
- README.rdoc
|
233
232
|
- VERSION
|
234
233
|
- EDGE_GEM_VERSION
|
235
234
|
- REVISION
|
235
|
+
- FAQ.md
|
236
|
+
- README.md
|
236
237
|
has_rdoc: true
|
237
238
|
homepage: http://haml.hamptoncatlin.com/
|
238
239
|
post_install_message:
|
data/FAQ
DELETED
@@ -1,138 +0,0 @@
|
|
1
|
-
= Frequently Asked Questions
|
2
|
-
|
3
|
-
== Haml
|
4
|
-
|
5
|
-
=== How do I put a punctuation mark after an element, like "<tt>I like <strong>cake</strong>!</tt>"?
|
6
|
-
|
7
|
-
Expressing the structure of a document
|
8
|
-
and expressing inline formatting are two very different problems.
|
9
|
-
Haml is mostly designed for structure,
|
10
|
-
so the best way to deal with formatting is to leave it to other languages
|
11
|
-
that are designed for it.
|
12
|
-
You could use Textile:
|
13
|
-
|
14
|
-
%p
|
15
|
-
:textile
|
16
|
-
I like *cake*!
|
17
|
-
|
18
|
-
or Markdown:
|
19
|
-
|
20
|
-
%p
|
21
|
-
:markdown
|
22
|
-
I like **cake**!
|
23
|
-
|
24
|
-
or plain old XHTML:
|
25
|
-
|
26
|
-
%p I like <strong>cake</strong>!
|
27
|
-
|
28
|
-
If you're inserting something that's generated by a helper, like a link,
|
29
|
-
then it's even easier:
|
30
|
-
|
31
|
-
%p== I like #{link_to 'chocolate', 'http://franschocolates.com'}!
|
32
|
-
|
33
|
-
=== How do I stop Haml from indenting the contents of my +pre+ and +textarea+ tags?
|
34
|
-
|
35
|
-
Because Haml automatically indents the HTML source code,
|
36
|
-
the contents of whitespace-sensitive tags like +pre+ and +textarea+
|
37
|
-
can get screwed up.
|
38
|
-
The solution is to replace the newlines inside these tags
|
39
|
-
with HTML newline entities (<tt>
</tt>),
|
40
|
-
which Haml does using the Haml::Helpers#preserve and Haml::Helpers#find_and_preserve helpers.
|
41
|
-
|
42
|
-
Normally, Haml will do this for you automatically
|
43
|
-
when you're using a tag that needs it
|
44
|
-
(this can be customized using the <tt>:preserve</tt> option;
|
45
|
-
see the Options section of the {Haml reference}(../classes/Haml.html)).
|
46
|
-
For example,
|
47
|
-
|
48
|
-
%p
|
49
|
-
%textarea= "Foo\nBar"
|
50
|
-
|
51
|
-
will be compiled to
|
52
|
-
|
53
|
-
<p>
|
54
|
-
<textarea>Foo
Bar</textarea>
|
55
|
-
</p>
|
56
|
-
|
57
|
-
However, if a helper is generating the tag,
|
58
|
-
Haml can't detect that and so you'll have to call +find_and_preserve+ yourself.
|
59
|
-
You can also use <tt>~</tt>, which is the same as <tt>=</tt>
|
60
|
-
except that it automatically runs +find_and_preserve+ on its input.
|
61
|
-
For example:
|
62
|
-
|
63
|
-
%p= find_and_preserve "<textarea>Foo\nBar</textarea>"
|
64
|
-
|
65
|
-
is the same as
|
66
|
-
|
67
|
-
%p~ "<textarea>Foo\nBar</textarea>"
|
68
|
-
|
69
|
-
and renders
|
70
|
-
|
71
|
-
<p><textarea>Foo
Bar</textarea></p>
|
72
|
-
|
73
|
-
=== How do I make my long lines of Ruby code look nicer in my Haml document?
|
74
|
-
|
75
|
-
Put them in a helper or your model.
|
76
|
-
|
77
|
-
Haml purposefully makes it annoying to put lots of Ruby code into your templates,
|
78
|
-
because lots of code doesn't belong in the view.
|
79
|
-
If you take that huge +link_to_remote+ call
|
80
|
-
and move it to a +update_sidebar_link+ helper,
|
81
|
-
it'll make your view both easier to read and more semantic.
|
82
|
-
|
83
|
-
If you absolutely must put lots of code in your template,
|
84
|
-
Haml offers a somewhat awkward multiline-continuation tool.
|
85
|
-
Put a <tt>|</tt> (pipe character) at the end of each line you want to be merged into one
|
86
|
-
(including the last line!).
|
87
|
-
For example:
|
88
|
-
|
89
|
-
%p= @this.is(way.too.much). |
|
90
|
-
code("and I should"). |
|
91
|
-
really_move.it.into( |
|
92
|
-
:a => @helper) |
|
93
|
-
|
94
|
-
=== I have Haml installed. Why is Rails (only looking for <tt>.html.erb</tt> files | rendering Haml files as plain text | rendering Haml files as blank pages)?
|
95
|
-
|
96
|
-
There are several reasons these things might be happening.
|
97
|
-
First of all, make sure vendor/plugins/haml really exists
|
98
|
-
and has an init.rb file in there.
|
99
|
-
Then try restarting Mongrel or WEBrick or whatever you might be using.
|
100
|
-
|
101
|
-
Finally, if none of these work,
|
102
|
-
chances are you've got some localization plugin like Globalize installed.
|
103
|
-
Such plugins often don't play nicely with Haml.
|
104
|
-
Luckily, there's usually an easy fix.
|
105
|
-
For Globalize, just edit globalize/lib/globalize/rails/action_view.rb
|
106
|
-
and change
|
107
|
-
|
108
|
-
@@re_extension = /\.(rjs|rhtml|rxml)$/
|
109
|
-
|
110
|
-
to
|
111
|
-
|
112
|
-
@@re_extension = /\.(rjs|rhtml|rxml|erb|builder|haml)$/
|
113
|
-
|
114
|
-
For other plugins, a little searching will probably turn up a way to fix them as well.
|
115
|
-
|
116
|
-
== Sass
|
117
|
-
|
118
|
-
=== Can I use a variable from my controller in my Sass file?
|
119
|
-
|
120
|
-
No. Sass files aren't views.
|
121
|
-
They're compiled once into static CSS files,
|
122
|
-
then left along until they're changed and need to be compiled again.
|
123
|
-
Not only don't you want to be running a full request cycle
|
124
|
-
every time someone requests a stylesheet,
|
125
|
-
but it's not a great idea to put much logic in there anyway
|
126
|
-
due to how browsers handle them.
|
127
|
-
|
128
|
-
If you really need some sort of dynamic CSS,
|
129
|
-
the best thing to do is put only the snippet you need to dynamically set
|
130
|
-
in the +head+ of your HTML document.
|
131
|
-
|
132
|
-
== You still haven't answered my question!
|
133
|
-
|
134
|
-
Sorry! Try looking at the Haml or Sass references,
|
135
|
-
in the doucmentation for the haml and Sass modules, respectively.
|
136
|
-
If you can't find an answer there,
|
137
|
-
feel free to ask in #haml on irc.freenode.net
|
138
|
-
or send an email to the {mailing list}[http://groups.google.com/group/haml?hl=en].
|