结果官方文档上写得清清楚楚:
/还是跟缩进相关。
The forward slash character, when placed at the beginning of a line, wraps all text after it in an HTML comment. For example:
%peanutbutterjelly
/ This is the peanutbutterjelly element
I like sandwiches!
is compiled to:
<peanutbutterjelly>
<!-- This is the peanutbutterjelly element -->
I like sandwiches!
</peanutbutterjelly>
The forward slash can also wrap indented sections of code. For example:
/
%p This doesn't render...
%div
%h1 Because it's commented out!
is compiled to:
<!--
<p>This doesn't render...</p>
<div>
<h1>Because it's commented out!</h1>
</div>
-->
至于反斜杠\(backslash),当然是转义字符啦。
%title
= @title
\- MySite
is compiled to:
<title>
MyPage
- MySite
</title>
具体请参考官方文档:
The full Haml reference
The full Sass reference
The RDoc documentation
没有评论:
发表评论