mato 0.1.0 → 0.2.0

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: cc964ed48f7d5e7d1d069e32b2ea3701118a6765
4
- data.tar.gz: 310ca6e0226f7ebaf1da5653d17a926580c8c476
3
+ metadata.gz: 267a8ba9de0057c636442e480e5a1f714053fd74
4
+ data.tar.gz: 1f712541459bdfd13d3e3fb06d028e74e97daabb
5
5
  SHA512:
6
- metadata.gz: b19a063ae37c6885ae08a1e1d961a3519f36dc19fd42370a09f95a143f5a1b3f84d5d17adb17f48e8247db268d8750f0c1759a54193e6f7c93e73696a08b45ba
7
- data.tar.gz: 1b6d1995d00dba709bd52d8138530ce8fe66699b5006060dc10277333569a23582fec03ab0f86a47380e3eee5328fbc6739b841152d5a5a27219d3f842ffca80
6
+ metadata.gz: c5c98659f58a6d9b14ba67e64391c65b437f8a3da079f4bf6b3e7c6e42995a324f12d4806431906828b6ab42328c5a07f3cd8ce3a156542206fa4482554f3b8e
7
+ data.tar.gz: b5103f9005d068465350f405391b730a2490dc54fb81fdfbb118dcd8973265945deb8d5f0d6656171e1d04f26666f6a467cf3ff68639f06574592b652d98178d
data/Gemfile CHANGED
@@ -5,8 +5,8 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in mato.gemspec
6
6
  gemspec
7
7
 
8
- gem "sanitize"
9
8
  gem "rouge"
9
+ gem "sanitize"
10
10
 
11
11
  gem "m"
12
12
  gem "minitest"
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Mato - Markdown Toolkit based on CommonMark [![Build Status](https://travis-ci.org/bitjourney/mato.svg?branch=master)](https://travis-ci.org/bitjourney/mato)
1
+ # Mato [![Build Status](https://travis-ci.org/bitjourney/mato.svg?branch=master)](https://travis-ci.org/bitjourney/mato)
2
2
 
3
- **Mato**, standing for **Ma**rkdown **To**oolkit, is an extensible markdown-based content processing toolkit, inspired by [HTML::Pipeline](https://github.com/jch/html-pipeline).
3
+ **Mato**, standing for **Ma**rkdown **To**oolkit, is an extensible, pipeline-based markdown processing toolkit, inspired by [HTML::Pipeline](https://github.com/jch/html-pipeline).
4
4
 
5
5
 
6
6
  This gem is built on [commonmarker](https://github.com/gjtorikian/commonmarker), a [CommonMark](https://github.com/jgm/CommonMark) implementation,
7
- which can parse markdown documents into AST.
7
+ which can parse markdown documents.
8
8
 
9
9
  ## Synopsis
10
10
 
@@ -78,9 +78,16 @@ Or install it yourself as:
78
78
 
79
79
  $ gem install mato
80
80
 
81
- ## Usage
81
+ ## Motivation
82
82
 
83
- TODO: Write usage instructions here
83
+ The original idea comes from [qiita-markdown](https://github.com/increments/qiita-markdown),
84
+ a markdown processing tool like mato, based on html-pipeline.
85
+
86
+ html-pipeline is a great tool that invents the idea of "pipeline", to filter HTML node (or `Nokogiri::XML::Node`) in each filter. This is safe, fast, and easy to enhance.
87
+
88
+ However, html-pipeline is not suitable for cache, esp. context-aware caching.
89
+
90
+ (TBD)
84
91
 
85
92
  ## Optional Dependencies
86
93
 
@@ -97,7 +104,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
97
104
 
98
105
  Bug reports and pull requests are welcome on GitHub at https://github.com/bitjourney/mato.
99
106
 
100
-
101
107
  ## License
102
108
 
103
109
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -10,14 +10,14 @@ module Mato
10
10
  DEFAULT_MARKDOWN_PARSE_OPTIONS = %i[
11
11
  DEFAULT
12
12
  VALIDATE_UTF8
13
- ]
13
+ ].freeze
14
14
 
15
15
  # https://github.com/gjtorikian/commonmarker#render-options
16
16
  DEFAULT_MARKDOWN_RENDER_OPTIONS = [
17
17
  :DEFAULT,
18
18
  :HARDBREAKS, # convert "\n" as <br/>
19
19
  # :SOURCEPOS, // TODO: enable it after assertions are supported
20
- ]
20
+ ].freeze
21
21
 
22
22
  # https://github.com/github/cmark/tree/master/extensions
23
23
  DEFAULT_MARKDOWN_EXTENSIONS = %i[
@@ -25,7 +25,7 @@ module Mato
25
25
  strikethrough
26
26
  autolink
27
27
  tagfilter
28
- ]
28
+ ].freeze
29
29
 
30
30
  # @return [Array<Proc>]
31
31
  attr_accessor :text_filters
@@ -54,7 +54,7 @@ module Mato
54
54
 
55
55
  def marshal_dump
56
56
  {
57
- fragment: fragment.to_s,
57
+ fragment: fragment.to_html(save_with: 0),
58
58
  }
59
59
  end
60
60
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mato
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["goro-fuj@bitjoureny.com"]
10
10
 
11
11
  spec.summary = 'MArkdown TOolkit'
12
- spec.description = 'An extensible markdown processing toolkit based on CommonMark'
12
+ spec.description = 'A pipeline-based markdown toolkit with CommonMark(er)'
13
13
  spec.homepage = "https://github.com/bitjourney/mato"
14
14
  spec.license = "MIT"
15
15
 
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: 0.1.0
4
+ version: 0.2.0
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-08-03 00:00:00.000000000 Z
11
+ date: 2017-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
- description: An extensible markdown processing toolkit based on CommonMark
69
+ description: A pipeline-based markdown toolkit with CommonMark(er)
70
70
  email:
71
71
  - goro-fuj@bitjoureny.com
72
72
  executables: []