From 960ee4a1856db8eadb96277bb2422edfa8f2a81c Mon Sep 17 00:00:00 2001 From: Gabriel Halley Date: Wed, 7 Oct 2015 23:11:24 -0400 Subject: removing whitespace all over --- haml.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index aed3dcae..847714e6 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -62,11 +62,11 @@ $ haml input_file.haml output_file.html %h1 Headline copy / To write multiline content, nest it instead -%p +%p This is a lot of content that we could probably split onto two separate lines. -/ +/ You can escape html by using the ampersand and equals sign ( &= ). This converts html-sensitive characters (&, /, :) into their html encoded equivalents. For example @@ -102,7 +102,7 @@ $ haml input_file.haml output_file.html / Inserting Ruby / ------------------------------------------- -/ +/ To output a Ruby value as the contents of a tag, use an equals sign followed by the Ruby code @@ -141,7 +141,7 @@ $ haml input_file.haml output_file.html / ------------------------------------------- / - Use the colon to define Haml filters, one example of a filter you can + Use the colon to define Haml filters, one example of a filter you can use is :javascript, which can be used for writing inline js :javascript -- cgit v1.2.3 From bb68e9483d8be6b7ba76f93e2fcfc07fabe03293 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Sat, 10 Oct 2015 14:38:50 +0530 Subject: Adding unordered/ordered list --- haml.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index 847714e6..dbc0a439 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -122,6 +122,12 @@ $ haml input_file.haml output_file.html if book do %p This is a book + +/ Adding ordered / unordered list +%ul + %li + =item1 + =item2 / Again, no need to add the closing tags to the block, even for the Ruby. -- cgit v1.2.3 From 091356a8da5b7dfca13075bec5089d700a1d9782 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Sat, 10 Oct 2015 14:42:30 +0530 Subject: Added table implementation in ruby --- haml.html.markdown | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index 847714e6..d44a4728 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -127,6 +127,25 @@ $ haml input_file.haml output_file.html Again, no need to add the closing tags to the block, even for the Ruby. Indentation will take care of that for you. +/ ------------------------------------------- +/ Inserting Table with bootstrap classes +/ ------------------------------------------- + +%table.table.table-hover + %thead + %tr + %th Header 1 + %th Header 2 + + %tr + %td Value1 + %td value2 + + %tfoot + %tr + %td + Foot value + / ------------------------------------------- / Inline Ruby / Ruby interpolation -- cgit v1.2.3 From 985d23a52b76593a120adff5381c2df3a80fe298 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Wed, 23 Aug 2017 10:14:39 +0200 Subject: Fix a bunch of typos --- haml.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index 0948e9ef..5dd4cb6d 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -36,7 +36,7 @@ $ haml input_file.haml output_file.html To write a multi line comment, indent your commented code to be wrapped by the forward slash --# This is a silent comment, which means it wont be rendered into the doc at all +-# This is a silent comment, which means it won't be rendered into the doc at all / ------------------------------------------- -- cgit v1.2.3 From 938988bd3487202047cdd37d8624e219ac5192df Mon Sep 17 00:00:00 2001 From: Vasiliy Petrov Date: Wed, 27 Sep 2017 22:13:18 +0300 Subject: [haml/en] Add more information --- haml.html.markdown | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index 5dd4cb6d..0ec5e244 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -3,6 +3,7 @@ language: haml filename: learnhaml.haml contributors: - ["Simon Neveu", "https://github.com/sneveu"] + - ["Vasiliy Petrov", "https://github.com/Saugardas"] --- Haml is a markup language predominantly used with Ruby that cleanly and simply describes the HTML of any web document without the use of inline code. It is a popular alternative to using Rails templating language (.erb) and allows you to embed Ruby code into your markup. @@ -11,7 +12,9 @@ It aims to reduce repetition in your markup by closing tags for you based on the You can also use Haml on a project independent of Ruby, by installing the Haml gem on your machine and using the command line to convert it to html. +```shell $ haml input_file.haml output_file.html +``` ```haml @@ -55,8 +58,18 @@ $ haml input_file.haml output_file.html -/ The div tag is the default element, so they can be written simply like this -.foo +/ + The div tag is the default element, so it can be omitted. + You can define only class/id using . or # + For example: + +%div.my_class + %div#my_id + +/ Can be written: + +.my_class + #my_id / To add content to a tag, add the text directly after the declaration %h1 Headline copy @@ -97,6 +110,15 @@ $ haml input_file.haml output_file.html / To write data-attributes, use the :data key with its value as another hash %div{:data => {:attribute => 'foo'}} +/ For Ruby version 1.9 or higher you can use Ruby's new hash syntax +%div{ data: { attribute: 'foo' } } + +/ Also you can use HTML-style attribute syntax. +%a(href='#' title='bar') + +/ And both syntaxes together +%a(href='#'){ title: @my_class.title } + / ------------------------------------------- / Inserting Ruby @@ -120,7 +142,7 @@ $ haml input_file.haml output_file.html - books.shuffle.each_with_index do |book, index| %h1= book - if book do + - if book do %p This is a book / Adding ordered / unordered list @@ -166,12 +188,33 @@ $ haml input_file.haml output_file.html / ------------------------------------------- / - Use the colon to define Haml filters, one example of a filter you can - use is :javascript, which can be used for writing inline js + Filters pass the block to another filtering program and return the result in Haml + To use filter type colon and the name of the filter +/ Markdown filter +:markdown + # Header + + Text **inside** *block* + +/ The code above is compiled into +

Header

+ +

Text inside block

+ +/ Javascript filter :javascript console.log('This is inline + +/ + There are many types of filters (:markdown, :javascript, :coffee, :css, :ruby and so on) + Also you can define own filter using Haml::Filters + ``` ## Additional resources -- cgit v1.2.3 From f0664e67c1d98afb0f7105768cf55af830f818e8 Mon Sep 17 00:00:00 2001 From: Vasiliy Petrov Date: Wed, 27 Sep 2017 22:18:48 +0300 Subject: fix formatting --- haml.html.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index 0ec5e244..fdfd0e07 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -61,13 +61,12 @@ $ haml input_file.haml output_file.html / The div tag is the default element, so it can be omitted. You can define only class/id using . or # - For example: + For example %div.my_class %div#my_id -/ Can be written: - +/ Can be written .my_class #my_id -- cgit v1.2.3 From da85cc8225531632e913676f124237b987684b81 Mon Sep 17 00:00:00 2001 From: Vasiliy Petrov Date: Thu, 28 Sep 2017 09:00:33 +0300 Subject: [haml/en] Fix mistakes in English text --- haml.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'haml.html.markdown') diff --git a/haml.html.markdown b/haml.html.markdown index fdfd0e07..bb8bdc54 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -188,18 +188,18 @@ $ haml input_file.haml output_file.html / Filters pass the block to another filtering program and return the result in Haml - To use filter type colon and the name of the filter + To use a filter, type a colon and the name of the filter / Markdown filter :markdown # Header - Text **inside** *block* + Text **inside** the *block* / The code above is compiled into

Header

-

Text inside block

+

Text inside the block

/ Javascript filter :javascript @@ -212,7 +212,7 @@ $ haml input_file.haml output_file.html / There are many types of filters (:markdown, :javascript, :coffee, :css, :ruby and so on) - Also you can define own filter using Haml::Filters + Also you can define your own filters using Haml::Filters ``` -- cgit v1.2.3