hamlit 2.10.1 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/REFERENCE.md +9 -0
- data/lib/hamlit/compiler/comment_compiler.rb +7 -5
- data/lib/hamlit/html.rb +8 -0
- data/lib/hamlit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea5913914011f369b96f45e350597bd102cd21adaa708c71bdd78e48a9d0379f
|
4
|
+
data.tar.gz: 1e02820e534617ffe3df742ac06aa28b2c8ff49e3bf7d6b22d67bac36017e6f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb42767eb9b77de2c881d7c0b3546b086dd97f65a05a4cd81d525ff3428e5065c33a41bd0dbddf19045682181fd3eaf73fb541dbf930554d3bbe80c7fee77aa
|
7
|
+
data.tar.gz: 47fe8b4b28777a5aaa84f37049b163625b24f1d111cb41e20df6275c2c49d3755cd8231aa81311019e0b961668c19f6ad43512d7eef6a7ff89dd26c38e6741ed
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. This
|
|
4
4
|
project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
|
5
5
|
[keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
|
6
6
|
|
7
|
+
## [2.11.0](https://github.com/k0kubun/hamlit/compare/v2.10.0...v2.10.1) - 2019-12-12
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Support Haml's _revealed_ conditional comment feature on `/![if !IE]` [#153](https://github.com/k0kubun/hamlit/issues/153).
|
12
|
+
*Thanks to @esb*
|
13
|
+
|
7
14
|
## [2.10.1](https://github.com/k0kubun/hamlit/compare/v2.10.0...v2.10.1) - 2019-11-28
|
8
15
|
|
9
16
|
### Added
|
data/REFERENCE.md
CHANGED
@@ -57,6 +57,7 @@ for full features in original implementation.
|
|
57
57
|
- [x] :plain
|
58
58
|
- [x] :preserve
|
59
59
|
- [x] :ruby
|
60
|
+
- `haml_io` API is not supported. Use [hamlit-haml\_io.gem](https://github.com/hamlit/hamlit-haml_io) if you need.
|
60
61
|
- [x] :sass
|
61
62
|
- [x] :scss
|
62
63
|
- [ ] :textile
|
@@ -224,6 +225,14 @@ Hamlit::RailsTemplate.set_options attr_quote: '"'
|
|
224
225
|
set :haml, { attr_quote: '"' }
|
225
226
|
```
|
226
227
|
|
228
|
+
## Ruby module
|
229
|
+
|
230
|
+
`Hamlit::Template` is a module registered to `Tilt`. You can use it like:
|
231
|
+
|
232
|
+
```rb
|
233
|
+
Hamlit::Template.new { "%strong Yay for HAML!" }.render
|
234
|
+
```
|
235
|
+
|
227
236
|
## Creating a custom filter
|
228
237
|
|
229
238
|
Currently it doesn't have filter registering interface compatible with Haml.
|
@@ -25,11 +25,13 @@ module Hamlit
|
|
25
25
|
condition = $1
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
content =
|
29
|
+
if node.children.empty?
|
30
|
+
[:static, " #{node.value[:text]} "]
|
31
|
+
else
|
32
|
+
yield(node)
|
33
|
+
end
|
34
|
+
[:html, :condcomment, condition, content, node.value[:revealed]]
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
data/lib/hamlit/html.rb
CHANGED
@@ -10,5 +10,13 @@ module Hamlit
|
|
10
10
|
end
|
11
11
|
super(opts)
|
12
12
|
end
|
13
|
+
|
14
|
+
# This dispatcher supports Haml's "revealed" conditional comment.
|
15
|
+
def on_html_condcomment(condition, content, revealed = false)
|
16
|
+
on_html_comment [:multi,
|
17
|
+
[:static, "[#{condition}]>#{'<!-->' if revealed}"],
|
18
|
+
content,
|
19
|
+
[:static, "#{'<!--' if revealed}<![endif]"]]
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
data/lib/hamlit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: temple
|