mato 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 195f9886598ddf1a08ec46a3b9bb30dfa21a943c
4
- data.tar.gz: ee6f5a7eeb28141a9b0a3fd63c9c4867e8bbb8bd
3
+ metadata.gz: 4080ede393c92ac8562d4f8c36392a5ea3603b50
4
+ data.tar.gz: b5b1251779ee2609957ddb93030280b4b5e225ea
5
5
  SHA512:
6
- metadata.gz: d094d454579750f042c6fc586233f9f94172efc490969b8e2d55b9c7ec9f3d5ad2efb59e881fba36e802cef7aee51e35ccc89fc80cde024b047e7a563447fc67
7
- data.tar.gz: 57481242dfab44c1c3718ba1a36d917ecf4af9da1722d8c29479e41ce58153dd27e869820c5075b1852e16dd078943c642cba77cead030308da8df6106e9b73a
6
+ metadata.gz: 8388bf35aa1c0f7eaa6ef6934a0bcdb533504efd2933372be8b1cd4fae1fb9fc5abba2e8a3503fbac47943e710b086f0f70501d76243ebdc09ae5da20e359a14
7
+ data.tar.gz: 0b167e4c19b5bf487436a178a0dd1b383998906ff8e043162b8836d64f108ee23da99fb12ea24c3860796383b7d0afc1e290b02c53408826fe599668f56716f1
@@ -1,15 +1,22 @@
1
1
  # The revision history of Mato
2
2
 
3
+ ## v1.3.1 - 2017/10/12
4
+
5
+ https://github.com/bitjourney/mato/compare/v1.3.0...v1.3.1
6
+
7
+
8
+ * Exclude `example/` from the package not to confuse RubyMine
9
+
3
10
  ## v1.3.0 - 2017/09/26
4
11
 
5
- https://github.com/bitjourney/mato/compare/v1.2.3...1.3.0
12
+ https://github.com/bitjourney/mato/compare/v1.2.3...v1.3.0
6
13
 
7
14
  * Added `timeout:`, `on_timeout:` and `on_error:` options to `append_*_filter` [#10](https://github.com/bitjourney/mato/pull/10)
8
15
 
9
16
 
10
17
  ## v1.2.3 - 2017/09/22
11
18
 
12
- https://github.com/bitjourney/mato/compare/v1.2.2...1.2.3
19
+ https://github.com/bitjourney/mato/compare/v1.2.2...v1.2.3
13
20
 
14
21
  * Requires rouge v3.0.0 or later with simpler code [#9](https://github.com/bitjourney/mato/pull/9)
15
22
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mato
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
17
+ f.match(%r{^(?:test|spec|features|example)/})
18
18
  end
19
19
  spec.bindir = "exe"
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mato
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - FUJI Goro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-26 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -69,8 +69,6 @@ files:
69
69
  - Rakefile
70
70
  - bin/console
71
71
  - bin/setup
72
- - example/hello.rb
73
- - example/toc.rb
74
72
  - lib/mato.rb
75
73
  - lib/mato/anchor_builder.rb
76
74
  - lib/mato/concerns/html_node_checkable.rb
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'mato'
5
-
6
- # User class that mocks ActiveRecord's
7
- User = Struct.new(:account)
8
- class User
9
- VALID_ACCOUNTS = %w(mato)
10
-
11
- # @return [Enumerable<User>]
12
- def self.where(account:)
13
- (account & VALID_ACCOUNTS).map do |name|
14
- User.new(name)
15
- end
16
- end
17
- end
18
-
19
- mato = Mato.define do |config|
20
- config.append_text_filter ->(text, _context) {
21
- # weave text
22
- }
23
-
24
- config.append_markdown_filter ->(doc, _context) {
25
- # weave doc
26
- }
27
-
28
- config.append_html_filter ->(doc, _context) {
29
- # weave doc
30
- }
31
-
32
- config.append_html_filter(Mato::HtmlFilters::TaskList.new)
33
- config.append_html_filter(Mato::HtmlFilters::MentionLink.new do |mention_candidate_map|
34
- candidate_accounts = mention_candidate_map.keys.map { |name| name.gsub(/^\@/, '') }
35
- User.where(account: candidate_accounts).each do |user|
36
- mention = "@#{user.account}"
37
- mention_candidate_map[mention].each do |node|
38
- node.replace("<a href='https://twitter.com/#{mention}' class='mention'>#{mention}</a>")
39
- end
40
- end
41
- end)
42
- end
43
-
44
- puts mato.process(<<~'MARKDOWN').render_html
45
- # Hello, @mato!
46
-
47
- @this_is_invalid_mention
48
-
49
- https://twitter.com/@kibe_la
50
-
51
- * [ ] a
52
- * [x] b
53
- MARKDOWN
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'mato'
5
-
6
- mato = Mato.define do |config|
7
- config.append_html_filter(Mato::HtmlFilters::SectionAnchor.new)
8
- end
9
-
10
- puts mato.process(<<~'MARKDOWN').render_html_toc
11
- # **First** Level Title
12
-
13
- ## **Second** Level Title
14
-
15
- ### **Third** Level Title
16
-
17
- ##### **Fifth** Level Title
18
-
19
- # **First** Level Title Again
20
- MARKDOWN