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