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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc231a76a98c6d527ca80a30385e3161a207814e9e1d3abe593929910e222795
4
- data.tar.gz: 21a57103fa4f6ac2df5ff712a8c1e2bc6f799cb59ec06d39769518b251d60139
3
+ metadata.gz: ea5913914011f369b96f45e350597bd102cd21adaa708c71bdd78e48a9d0379f
4
+ data.tar.gz: 1e02820e534617ffe3df742ac06aa28b2c8ff49e3bf7d6b22d67bac36017e6f8
5
5
  SHA512:
6
- metadata.gz: 95b3596d2f44759d90c3c02065c0986cf107179513bf31a8bb1116d35064cf2049e2ad342c30b884e938fef1a2c228f11ce15c5f4350bb09143d5d19dcf753ff
7
- data.tar.gz: dd36a42a6aa53e8f2b3e45865d077dc459d91ec0388a784b3ed5e2420bcaebc3f9b6c01f020d3e68acc17a9e209e8e0f1ac7ab9915390717fbcba2348fdead16
6
+ metadata.gz: 0cb42767eb9b77de2c881d7c0b3546b086dd97f65a05a4cd81d525ff3428e5065c33a41bd0dbddf19045682181fd3eaf73fb541dbf930554d3bbe80c7fee77aa
7
+ data.tar.gz: 47fe8b4b28777a5aaa84f37049b163625b24f1d111cb41e20df6275c2c49d3755cd8231aa81311019e0b961668c19f6ad43512d7eef6a7ff89dd26c38e6741ed
@@ -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
@@ -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
- if node.children.empty?
29
- [:html, :condcomment, condition, [:static, " #{node.value[:text]} "]]
30
- else
31
- [:html, :condcomment, condition, yield(node)]
32
- end
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
@@ -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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.10.1'
3
+ VERSION = '2.11.0'
4
4
  end
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.10.1
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-29 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: temple