Created
September 19, 2011 07:42
-
-
Save mamantoha/1226118 to your computer and use it in GitHub Desktop.
Slim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Допускається будь-який варіант | |
h1 class=page_header_class = page_header | |
h1{class=page_header_class} = page_header | |
h1[class=page_header_class] = page_header | |
h1(class=page_header_class) = page_header | |
/ При використанні обгортки, атрибути можуть займати кілька рядків | |
h1( class=page_header_class | |
id="myid")= page_header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Блок нижче закоментований і не буде виведений | |
/.comments | |
- @comments.each do |comment| | |
= comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a href="#{url_for @user}" = @user.name | |
a href=url_for(@user) = @user.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
title Slim Test | |
meta name="keywords" content="slim, syntax" | |
javascript: | |
$(function() { | |
alert('Hello World'); | |
}); | |
haml: | |
#someid.someclass{:this => 'test'} Content in haml | |
erb: | |
<%= some_method(@request) %> | |
body | |
/ comment block | |
with multiple lines | |
This is another line | |
h1 = @page_title | |
p#notice.message | |
| Welcome to the the syntax test. | |
This file is to exercise the various markup. | |
This is another line | |
- unless @users.empty? | |
table | |
- for user in users do | |
tr | |
td.user id=some_ruby('ere', @rme) data-test="some text #{with @ruby}" = @post.name | |
- else | |
p There are no users. | |
/ Single comment line | |
#content Hello #{@user.name}! Welcome to the test page! | |
Try out Slim! | |
= function_with_many_parameters(:a, @variable, :option => 1) | |
p.text | |
' Another text block | |
with multiple lines | |
= link_to('Test', @site) | |
.text#footer | |
' Footer text block | |
with multiple lines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%blockquote{:id => "quote-#{@quote.id}", :class => "quote"} | |
%p{:class="title"}= @quote.title | |
%p{:style => "padding:1em;"}= @quote.body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blockquote id="quote-#{@quote.id}" class="quote" | |
p class="title" = @quote.title | |
p style="padding:1em;" = @quote.body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Ці два рядки ідентичні | |
#nav.top | |
div id="nav" class="top" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment