hamlit 2.10.1-java → 2.11.0-java
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: fec8304753bc50c9a95858f662c6edb6e23738d9b4d872abfa842c6c9d0f0dbf
|
4
|
+
data.tar.gz: 8094817a2939477cb4bf54ffd90d0c544c9b76e9035ab6e25f7ea0464006badc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51342978815a225ccde30a34ad2acea63e1914f73665ba6c928983c05c947fbcceea1506288eea1f7bb194f4b385f3b851974387ff7cbabef3fbb89ecd404491
|
7
|
+
data.tar.gz: 6b59ba2b4975c712f822f47b24ecbdeebdb138372f8df3345ff325de9b09e0fcbfd0b876abd426dc5da8fe9ece12f032ba7b18462c1dd9c3c3403f5ede40289a
|
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: java
|
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
|
requirement: !ruby/object:Gem::Requirement
|