mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
properly indent a bunch of code samples
This commit is contained in:
parent
bd820f5d41
commit
1e838f74b6
3 changed files with 76 additions and 77 deletions
46
README.rdoc
46
README.rdoc
|
@ -232,35 +232,35 @@ Taking the idea of constants a bit further are mixins.
|
||||||
These let you group whole swathes of CSS attributes into a single
|
These let you group whole swathes of CSS attributes into a single
|
||||||
directive and then include those anywhere you want:
|
directive and then include those anywhere you want:
|
||||||
|
|
||||||
=blue-border
|
=blue-border
|
||||||
:border
|
:border
|
||||||
:color blue
|
:color blue
|
||||||
:width 2px
|
:width 2px
|
||||||
:style dotted
|
:style dotted
|
||||||
|
|
||||||
.comment
|
.comment
|
||||||
+blue-border
|
+blue-border
|
||||||
:padding 2px
|
:padding 2px
|
||||||
:margin 10px 0
|
:margin 10px 0
|
||||||
|
|
||||||
.reply
|
.reply
|
||||||
+blue-border
|
+blue-border
|
||||||
|
|
||||||
becomes:
|
becomes:
|
||||||
|
|
||||||
.comment {
|
.comment {
|
||||||
border-color: blue;
|
border-color: blue;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
border-style: dotted;
|
border-style: dotted;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reply {
|
.reply {
|
||||||
border-color: blue;
|
border-color: blue;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
border-style: dotted;
|
border-style: dotted;
|
||||||
}
|
}
|
||||||
|
|
||||||
A comprehensive list of features is in
|
A comprehensive list of features is in
|
||||||
the documentation for the Sass module.
|
the documentation for the Sass module.
|
||||||
|
|
29
lib/haml.rb
29
lib/haml.rb
|
@ -651,9 +651,8 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
# yo
|
# yo
|
||||||
# </p>
|
# </p>
|
||||||
#
|
#
|
||||||
# If the <tt>:escape_html</tt> option is set,
|
# If the <tt>:escape_html</tt> option is set, <tt>=</tt> will sanitize any
|
||||||
# = will sanitize any HTML-sensitive characters generated by the script.
|
# HTML-sensitive characters generated by the script. For example:
|
||||||
# For example:
|
|
||||||
#
|
#
|
||||||
# = '<script>alert("I\'m evil!");</script>'
|
# = '<script>alert("I\'m evil!");</script>'
|
||||||
#
|
#
|
||||||
|
@ -804,29 +803,29 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
#
|
#
|
||||||
# For example:
|
# For example:
|
||||||
#
|
#
|
||||||
# %p foo
|
# %p foo
|
||||||
# -# This is a comment
|
# -# This is a comment
|
||||||
# %p bar
|
# %p bar
|
||||||
#
|
#
|
||||||
# is compiled to:
|
# is compiled to:
|
||||||
#
|
#
|
||||||
# <p>foo</p>
|
# <p>foo</p>
|
||||||
# <p>bar</p>
|
# <p>bar</p>
|
||||||
#
|
#
|
||||||
# You can also nest text beneath a silent comment.
|
# You can also nest text beneath a silent comment.
|
||||||
# None of this text will be rendered.
|
# None of this text will be rendered.
|
||||||
# For example:
|
# For example:
|
||||||
#
|
#
|
||||||
# %p foo
|
# %p foo
|
||||||
# -#
|
# -#
|
||||||
# This won't be displayed
|
# This won't be displayed
|
||||||
# Nor will this
|
# Nor will this
|
||||||
# %p bar
|
# %p bar
|
||||||
#
|
#
|
||||||
# is compiled to:
|
# is compiled to:
|
||||||
#
|
#
|
||||||
# <p>foo</p>
|
# <p>foo</p>
|
||||||
# <p>bar</p>
|
# <p>bar</p>
|
||||||
#
|
#
|
||||||
# == Other Useful Things
|
# == Other Useful Things
|
||||||
#
|
#
|
||||||
|
|
78
lib/sass.rb
78
lib/sass.rb
|
@ -128,7 +128,7 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
#
|
#
|
||||||
# By default, either attribute syntax may be used.
|
# By default, either attribute syntax may be used.
|
||||||
# If you want to force one or the other,
|
# If you want to force one or the other,
|
||||||
# see the :attribute_syntax option below.
|
# see the <tt>:attribute_syntax</tt> option below.
|
||||||
#
|
#
|
||||||
# === Nested Rules
|
# === Nested Rules
|
||||||
#
|
#
|
||||||
|
@ -606,28 +606,28 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
# To define a mixin you use a slightly modified form of selector syntax.
|
# To define a mixin you use a slightly modified form of selector syntax.
|
||||||
# For example the 'large-text' mixin is defined as follows:
|
# For example the 'large-text' mixin is defined as follows:
|
||||||
#
|
#
|
||||||
# =large-text
|
# =large-text
|
||||||
# :font
|
# :font
|
||||||
# :family Arial
|
# :family Arial
|
||||||
# :size 20px
|
# :size 20px
|
||||||
# :weight bold
|
# :weight bold
|
||||||
# :color #ff0000
|
# :color #ff0000
|
||||||
#
|
#
|
||||||
# The initial '=' marks this as a mixin rather than a standard selector.
|
# The initial '=' marks this as a mixin rather than a standard selector.
|
||||||
# The CSS rules that follow won't be included until the mixin is referenced later on.
|
# The CSS rules that follow won't be included until the mixin is referenced later on.
|
||||||
# Anything you can put into a standard selector,
|
# Anything you can put into a standard selector,
|
||||||
# you can put into a mixin definition. e.g.
|
# you can put into a mixin definition. e.g.
|
||||||
#
|
#
|
||||||
# =clearfix
|
# =clearfix
|
||||||
# display: inline-block
|
# display: inline-block
|
||||||
# &:after
|
# &:after
|
||||||
# content: "."
|
# content: "."
|
||||||
# display: block
|
# display: block
|
||||||
# height: 0
|
# height: 0
|
||||||
# clear: both
|
# clear: both
|
||||||
# visibility: hidden
|
# visibility: hidden
|
||||||
# * html &
|
# * html &
|
||||||
# height: 1px
|
# height: 1px
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# === Mixing it in
|
# === Mixing it in
|
||||||
|
@ -637,23 +637,23 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
# So to inline the 'large-text' defined earlier,
|
# So to inline the 'large-text' defined earlier,
|
||||||
# we include the statment '+large-text' in our selector definition thus:
|
# we include the statment '+large-text' in our selector definition thus:
|
||||||
#
|
#
|
||||||
# .page-title
|
# .page-title
|
||||||
# +large-text
|
# +large-text
|
||||||
# :padding 4px
|
# :padding 4px
|
||||||
# :margin
|
# :margin
|
||||||
# :top 10px
|
# :top 10px
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# This will produce the following CSS output:
|
# This will produce the following CSS output:
|
||||||
#
|
#
|
||||||
# .page-title {
|
# .page-title {
|
||||||
# font-family: Arial;
|
# font-family: Arial;
|
||||||
# font-size: 20px;
|
# font-size: 20px;
|
||||||
# font-weight: bold;
|
# font-weight: bold;
|
||||||
# color: #ff0000;
|
# color: #ff0000;
|
||||||
# padding: 4px;
|
# padding: 4px;
|
||||||
# margin-top: 10px;
|
# margin-top: 10px;
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# Any number of mixins may be defined and there is no limit on
|
# Any number of mixins may be defined and there is no limit on
|
||||||
# the number that can be included in a particular selector.
|
# the number that can be included in a particular selector.
|
||||||
|
@ -661,16 +661,16 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
||||||
# Mixin definitions can also include references to other mixins defined earlier in the file.
|
# Mixin definitions can also include references to other mixins defined earlier in the file.
|
||||||
# E.g.
|
# E.g.
|
||||||
#
|
#
|
||||||
# =highlighted-background
|
# =highlighted-background
|
||||||
# background:
|
# background:
|
||||||
# color: #fc0
|
# color: #fc0
|
||||||
# =header-text
|
# =header-text
|
||||||
# font:
|
# font:
|
||||||
# size: 20px
|
# size: 20px
|
||||||
#
|
#
|
||||||
# =compound
|
# =compound
|
||||||
# +highlighted-background
|
# +highlighted-background
|
||||||
# +header-text
|
# +header-text
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# == Output Style
|
# == Output Style
|
||||||
|
|
Loading…
Add table
Reference in a new issue