nishisuke-blog-syntax 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 86c218b0f1add7c6336f2a32ba68c7948511bf66c69e1d54dfdfc22ae7ae2fa8
4
- data.tar.gz: 75e83c660a69df59a5e079d4949b07b4fe7cfb9c59fce70c475511a68fcaa9dd
3
+ metadata.gz: be771c601a7a4c581734c989b387f39ed6c7d9b5969f93ac642d55a9b8a6b000
4
+ data.tar.gz: 054141f1956bedc4aad98bad7cd20633fe8a82c66dbe46cb686aed6d07d141a4
5
5
  SHA512:
6
- metadata.gz: cccd94cec6227ea0c3e8f4f4fdd6bde09504707cc8788200aa4e640dbc3832070eed9db81692f52ad58945d8dd8af6c8650b208feac619826e827e80d8a31313
7
- data.tar.gz: 5f38bd69cd1ca2aae819c051bd79460d79913380d9e569d2c4dd58109a2e2ab693c7f29c668e82e755140f49a24d7007d65a1e65809975b48b482aae59401f0e
6
+ metadata.gz: f997847397efad6ce7291bbf9e531b1fcde18136f6f5217b2422c1c29d3620751ad1e1d10ba9d3dbd46d0342133a9e88b3a3ec1944a7cc14ec0a298a8f262bae
7
+ data.tar.gz: 8c3fc227d143f9c3c3d2136be581b8e91786ba405f760d8c34039fa1545be82aaedb5039f01334f000a8494c690fa887a1809eb2536f2d23ee1df0f33eadcbe7
@@ -0,0 +1,21 @@
1
+ require 'nishisuke_blog_syntax/formatter'
2
+
3
+ module NishisukeBlogSyntax
4
+ module Formatter
5
+ class HeadThreeFormatter < FormatterBase
6
+ SUBSTITUTE_REGEXP = /^### .*$/
7
+ PARSE_REGEXP = /^### (.*)$/
8
+
9
+ private
10
+
11
+ def regexp
12
+ SUBSTITUTE_REGEXP
13
+ end
14
+
15
+ def substitute(matched)
16
+ content_str = matched.match(PARSE_REGEXP)[1]
17
+ "<h3>#{content_str}</h3>"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ require 'nishisuke_blog_syntax/formatter'
2
+
3
+ module NishisukeBlogSyntax
4
+ module Formatter
5
+ class ListFormatter < FormatterBase
6
+ SUBSTITUTE_REGEXP = /^- .*$/
7
+ PARSE_REGEXP = /^- (.*)$/
8
+
9
+ private
10
+
11
+ def regexp
12
+ SUBSTITUTE_REGEXP
13
+ end
14
+
15
+ def substitute(matched)
16
+ content_str = matched.match(PARSE_REGEXP)[1]
17
+ "<li>#{content_str}</li>"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -2,6 +2,8 @@ require 'nishisuke_blog_syntax/formatter/code_formatter'
2
2
  require 'nishisuke_blog_syntax/formatter/shell_formatter'
3
3
  require 'nishisuke_blog_syntax/formatter/paragraph_formatter'
4
4
  require 'nishisuke_blog_syntax/formatter/sub_headline_formatter'
5
+ require 'nishisuke_blog_syntax/formatter/head_three_formatter'
6
+ require 'nishisuke_blog_syntax/formatter/list_formatter'
5
7
 
6
8
  module NishisukeBlogSyntax
7
9
  class RawText
@@ -26,6 +28,8 @@ module NishisukeBlogSyntax
26
28
  Formatter::CodeFormatter.new,
27
29
  Formatter::ParagraphFormatter.new,
28
30
  Formatter::SubHeadlineFormatter.new,
31
+ Formatter::HeadThreeFormatter.new,
32
+ Formatter::ListFormatter.new,
29
33
  ]
30
34
  end
31
35
 
@@ -1,3 +1,3 @@
1
1
  module NishisukeBlogSyntax
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nishisuke-blog-syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nishisuke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-13 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,6 +71,8 @@ files:
71
71
  - lib/nishisuke_blog_syntax.rb
72
72
  - lib/nishisuke_blog_syntax/formatter.rb
73
73
  - lib/nishisuke_blog_syntax/formatter/code_formatter.rb
74
+ - lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb
75
+ - lib/nishisuke_blog_syntax/formatter/list_formatter.rb
74
76
  - lib/nishisuke_blog_syntax/formatter/paragraph_formatter.rb
75
77
  - lib/nishisuke_blog_syntax/formatter/shell_formatter.rb
76
78
  - lib/nishisuke_blog_syntax/formatter/sub_headline_formatter.rb