将 HAML 缩进从 2 个空格更改为 4 个空格
Change HAML indentation from 2 to 4 spaces
在 Rails 应用程序的 Ruby 上,有没有办法将 HAML 的缩进从 2 个空格更改为 4 个空格?
如果我未能正确缩进,我会得到:The line was indented 2 levels deeper than the previous line.
取自http://haml.info/docs/yardoc/#indentation
Haml’s indentation can be made up of one or more tabs or spaces.
However, indentation must be consistent within a given document. Hard
tabs and spaces can’t be mixed, and the same number of tabs or spaces
must be used throughout.
这是我的测试:
test.haml
#content
.title
%h1 Test
结果:
haml test.haml
<div id='content'>
<div class='title'>
<h1>Test</h1>
</div>
</div>
在 Rails 应用程序的 Ruby 上,有没有办法将 HAML 的缩进从 2 个空格更改为 4 个空格?
如果我未能正确缩进,我会得到:The line was indented 2 levels deeper than the previous line.
取自http://haml.info/docs/yardoc/#indentation
Haml’s indentation can be made up of one or more tabs or spaces. However, indentation must be consistent within a given document. Hard tabs and spaces can’t be mixed, and the same number of tabs or spaces must be used throughout.
这是我的测试:
test.haml
#content
.title
%h1 Test
结果:
haml test.haml
<div id='content'>
<div class='title'>
<h1>Test</h1>
</div>
</div>