From 41c5421b1571d0c05273bab66528c5b7c4fae978 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Sat, 23 Feb 2008 01:08:47 -0800 Subject: [PATCH] Fleshing out documentation for ==. --- lib/haml.rb | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/haml.rb b/lib/haml.rb index cd0d3ca8..f82c3f2a 100644 --- a/lib/haml.rb +++ b/lib/haml.rb @@ -601,19 +601,6 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # yo #

# -# You can also use two equal signs, ==, -# along with conventional Ruby string-embedding syntax -# to easily embed Ruby code in otherwise static text. -# For example: -# -# %p -# == 1 + 1 = #{1 + 1} -# -# is compiled to: -# -#

-# 1 + 1 = 2 -#

# # ==== - # @@ -637,6 +624,22 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # hello there you! #

# +# ==== == +# +# Two equals characters interpolates Ruby code into plain text, +# similarly to Ruby string interpolation. +# For example, +# +# %p== This is #{h quality} cake! +# +# is the same as +# +# %p= "This is #{h quality} cake!" +# +# and might compile to +# +#

This is scrumptious cake!

+# # ===== Blocks # # Ruby blocks, like XHTML tags, don't need to be explicitly closed in Haml.