何を勉強したか、
何を理解したか、
まとめるためにここに書きます🐰
Slimとは
ruby製テンプレートエンジン。
HTMLの代替できる。
特徴
めちゃシンプルにかける。
そのため見やすい。
コード量が少ない。
そんなに難しくない。
Slimのコマンド
Slimで使うコマンドはslimrb
slimrbとなるのは、多分ruby製のテンプレートエンジンだからかな?
Slimの拡張子
拡張子は.slim
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Slim書いて見た</title>
</head>
<body class="sample">
<div id="contents">
<h1>Slim</h1>
<img alt="Slimだよ" src="http://www.slim.com/images/slim.jpg" />
<p>アダダダダダダダダダ</p>
<p>アダダダダダダダダダ</p>
</div>
</body>
</html>
index.slim
doctype html
html
head
meta charset="utf-8"
title Slim書いて見た
body.sample
#contents
h1 Slim
img src="http://www.slim.com/images/slim.jpg" alt="Slimだよ"
p アダダダダダダダダダ
p
| アダダダダダダダダダ
アダダダダダダダダダ
コメントの書き方
Slimのコメントは/を使うとコメントにすることができる。
コードのはじめに/を書く。
豆知識
| (パイプ)って読むんだそうな。知らなかった。
詳しくはSlimの公式github pageへ
参考にしたサイト,参考になるサイト
https://qiita.com/yterajima/items/53fd0387279510ff082a
https://qiita.com/pugiemonn/items/b64171952d958dc4d6be