commonmarker-rouge 1.5.0 → 1.5.1

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
- SHA1:
3
- metadata.gz: f3a0bbfe05d0f119e91121a31b087445435e5996
4
- data.tar.gz: 6e89591531d48758724eb0ec0e82953d57da987b
2
+ SHA256:
3
+ metadata.gz: 38098d518c90e5a7622cc329a10b5bb44364b5cce34a2f8f445c6f2c7b4cace3
4
+ data.tar.gz: e982b682aa9d73f03a5679d75dfb50299befd6eb67bca03fd275866d5c54b49f
5
5
  SHA512:
6
- metadata.gz: cc5b8b8cf1d531dea462b7be0f8f201598d50596f46de8f9ae15ece3dbb5121e09da5fb1724c6047204cbc15802032e37a353d8285db283b87cb6060e4b6d443
7
- data.tar.gz: f0e0fbccb43f220234f191831f7284536286d4ba90bd1084461dd2d9eb35d1fea908c09d7e45aee327bd3f345d1b1e54abb1995dd2436e76f06f5b22f7691b79
6
+ metadata.gz: 651e4d9cd9d435bef2349384fcd6500637f6887ac75daacece24ef0110b55a0cd2ff47491d1883b693fba66bdbba063a507724d85c16ca84d4d35256b780f947
7
+ data.tar.gz: d4914a022d511c1d8f46371f37aeaee5f98e45d538071420d15c04e8db84196b135764ee3243e30bcc92d0d22a34eedac49ddd630313317bf3c780c2f034a93f
data/.gitignore CHANGED
@@ -10,6 +10,9 @@
10
10
  /test/version_tmp/
11
11
  /tmp/
12
12
 
13
+ ## IDE
14
+ /.idea
15
+
13
16
  ## Specific to RubyMotion:
14
17
  .dat*
15
18
  .repl_history
@@ -20,12 +23,14 @@ build/
20
23
  /_yardoc/
21
24
  /doc/
22
25
  /rdoc/
26
+ /docs/*.html
23
27
 
24
28
  ## Environment normalization:
25
29
  /.bundle/
26
30
  /vendor/bundle
27
31
  /lib/bundler/man/
28
32
  Gemfile.lock
33
+ Gemfile.*.lock
29
34
  .ruby-version
30
35
  .ruby-gemset
31
36
 
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,52 @@
1
+ stages:
2
+ - test
3
+
4
+ cache:
5
+ key: bundler-cache
6
+ paths:
7
+ - vendor/bundle
8
+
9
+ .test:
10
+ before_script:
11
+ - bundle config path `pwd`/vendor/bundle
12
+ - bundle config without development_extra
13
+ script:
14
+ - bundle update
15
+ - bundle exec rspec
16
+ - bundle update --gemfile=Gemfile.lowest
17
+ - bundle exec rspec
18
+
19
+ test-2.3:
20
+ extends: .test
21
+ stage: test
22
+ image: ruby:2.3
23
+
24
+ test-2.4:
25
+ extends: .test
26
+ stage: test
27
+ image: ruby:2.4
28
+
29
+ test-2.5:
30
+ extends: .test
31
+ stage: test
32
+ image: ruby:2.5
33
+
34
+ test-2.6:
35
+ extends: .test
36
+ stage: test
37
+ image: ruby:2.6
38
+
39
+ test-2.7:
40
+ extends: .test
41
+ stage: test
42
+ image: ruby:2.7
43
+
44
+ test-3.0:
45
+ extends: .test
46
+ stage: test
47
+ image: ruby:3.0
48
+
49
+ test-latest:
50
+ extends: .test
51
+ stage: test
52
+ image: ruby:latest
data/CHANGELOG.md CHANGED
@@ -1,50 +1,58 @@
1
1
  # Changelog
2
2
 
3
- ## 1.5.0
3
+ ## 1.x
4
4
 
5
- *December 01, 2018*
5
+ ### 1.5.1
6
+
7
+ *Dec 9, 2023*
8
+
9
+ * Allow Rouge 4
10
+
11
+ ### 1.5.0
12
+
13
+ *Dec 1, 2018*
6
14
 
7
15
  * Added support for extensions and render options ([#3])
8
16
  * Fixed incompatibility with commonmarker 0.18
9
17
  * commonmarker 0.18 is now required
10
18
 
11
- ## 1.4.0
19
+ ### 1.4.0
12
20
 
13
- *September 26, 2017*
21
+ *Sep 26, 2017*
14
22
 
15
23
  * `:formatter` option now accepts formatter instance, for formatter class use `:formatter_class`.
16
24
  Class argument for `:formatter` is deprecated and will be removed in 2.0
17
25
  * fix `render_html` not properly accepting options
18
26
 
19
- ## 1.3.0
27
+ ### 1.3.0
20
28
 
21
- *September 26, 2017*
29
+ *Sep 26, 2017*
22
30
 
23
31
  * Allow Rouge 3.*
24
32
 
25
- ## 1.2.0
33
+ ### 1.2.0
26
34
 
27
- *June 09, 2017*
35
+ *Jun 9, 2017*
28
36
 
29
37
  * Add language-%fence_info% to highlighter-rouge div wrapper ([#2])
30
38
  * Allow using Rouge 2.x
31
39
 
32
- ## 1.1.0
40
+ ### 1.1.0
33
41
 
34
42
  *May 24, 2017*
35
43
 
36
44
  * Fixed incompatibility with commonmarker >= 0.14.5 ([#1])
37
45
  * commonmarker >= 0.14.5 is now required
38
46
 
39
- ## 1.0.1
47
+ ### 1.0.1
40
48
 
41
- *November 17, 2016*
49
+ *Nov 17, 2016*
42
50
 
43
51
  * Relax commonmarker requirement
44
52
 
45
- ## 1.0.0
53
+ ### 1.0.0
46
54
 
47
- *April 05, 2016*
55
+ *Apr 5, 2016*
48
56
 
49
57
  * Initial release
50
58
 
data/Gemfile CHANGED
@@ -1,3 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # for low ruby versions
4
+ gem 'ruby-enum', '~> 0.7.0'
5
+
6
+ group :development_extra do
7
+ gem 'simplecov'
8
+ gem 'pry'
9
+ end
10
+
3
11
  gemspec
data/Gemfile.lowest ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # for low ruby versions
4
+ gem 'ruby-enum', '~> 0.7.0'
5
+
6
+ gemspec
7
+
8
+ # lowest dependencies to test
9
+
10
+ gem 'commonmarker', '0.18.0'
11
+ gem 'rouge', '1.10'
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # CommonMarker+Rouge
2
2
 
3
- [![Gem](https://img.shields.io/gem/v/commonmarker-rouge.svg?maxAge=2592000)](https://rubygems.org/gems/commonmarker-rouge)
4
- [![Travis](https://img.shields.io/travis/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://travis-ci.org/sandfoxme/commonmarker-rouge)
5
- [![Code Climate](https://img.shields.io/codeclimate/maintainability/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge)
6
- [![Code Climate](https://img.shields.io/codeclimate/c/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/coverage)
3
+ [![Gem](https://img.shields.io/gem/v/commonmarker-rouge.svg?style=flat-square)](https://rubygems.org/gems/commonmarker-rouge)
4
+ [![Gitlab pipeline status](https://img.shields.io/gitlab/pipeline/sandfox/commonmarker-rouge/master.svg?style=flat-square)](https://gitlab.com/sandfox/commonmarker-rouge/-/pipelines)
7
5
 
8
6
  A [CommonMarker](https://rubygems.org/gems/commonmarker) wrapper with
9
7
  syntax highlight support by [Rouge](https://rubygems.org/gems/rouge).
@@ -13,8 +11,6 @@ syntax highlight support by [Rouge](https://rubygems.org/gems/rouge).
13
11
  `commonmarker-rouge` currently works only with renderer in `:UNSAFE` mode.
14
12
  Don't forget to set `:UNSAFE` manually if you're overwriting the renderer mode.
15
13
 
16
- If you know how to fix this behavior please comment in [Issue #5](https://github.com/sandfoxme/commonmarker-rouge/issues/5)
17
-
18
14
  ## Installation
19
15
 
20
16
  Add these lines to your application's Gemfile:
@@ -23,38 +19,14 @@ Add these lines to your application's Gemfile:
23
19
  gem 'commonmarker-rouge'
24
20
  ```
25
21
 
26
- ## Usage
27
-
28
- ```ruby
29
- # use default CommonMarker class and Rouge::Formatters::HTML formatter
30
- CommonMarker::Rouge.render_html(content)
31
-
32
- # get CommonMarker parsed AST
33
- CommonMarker::Rouge.render_doc(content)
22
+ ## Documentation
34
23
 
35
- # pass options to CommonMarker
36
- CommonMarker::Rouge.render_html(content, [:SOURCEPOS])
24
+ Read full documentation here: <https://sandfox.dev/ruby/commonmarker-rouge.html>
37
25
 
38
- # use custom CommonMarker wrapper (must provide compatible render_doc)
39
- CommonMarker::Rouge.render_html(content, cmark_class: CommonMarkerWrapper)
26
+ ## Support
40
27
 
41
- # use custom Rouge formatter by class
42
- CommonMarker::Rouge.render_html(content, formatter_class: Rouge::Formatters::HTMLLinewise)
43
- # or by instance
44
- CommonMarker::Rouge.render_html(content, formatter: Rouge::Formatters::HTMLTable.new(
45
- Rouge::Formatters::HTML.new
46
- ))
47
-
48
- # pass some options to Rouge
49
- CommonMarker::Rouge.render_html(content, options: { css_class: 'custom-class' })
50
- # or
51
- CommonMarker::Rouge.render_html(content, formatter: Rouge::Formatters::HTMLTable.new(
52
- Rouge::Formatters::HTML.new, code_class: 'rouge-code'
53
- ))
54
-
55
- ```
28
+ Please file issues on our main repo at GitLab: <https://gitlab.com/sandfox/commonmarker-rouge/-/issues>
56
29
 
57
30
  ## License
58
31
 
59
32
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
60
-
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'commonmarker-rouge'
8
8
  spec.version = CommonMarker::Rouge::VERSION
9
9
  spec.authors = ['Anton Smirnov']
10
- spec.email = ['sandfox@sandfox.me']
10
+ spec.email = ['sandfox+gem@sandfox.me']
11
11
 
12
12
  spec.summary = 'CommonMarker wrapper with Rouge syntax highlighter'
13
- spec.homepage = 'https://github.com/sandfoxme/commonmarker-rouge'
13
+ spec.homepage = 'https://sandfox.dev/ruby/commonmarker-rouge.html'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -21,12 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = '>= 2.0.0'
22
22
 
23
23
  spec.add_dependency 'commonmarker', '>= 0.18.0', '< 1.0'
24
- spec.add_dependency 'rouge', '>= 1.10', '< 4'
24
+ spec.add_dependency 'rouge', '>= 1.10', '< 5'
25
25
 
26
- spec.add_development_dependency 'bundler', '~> 1.11'
27
- spec.add_development_dependency 'rake', '~> 12.0'
26
+ spec.add_development_dependency 'bundler', '>= 1.11'
27
+ spec.add_development_dependency 'rake', '>= 12.0', '< 14'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
- spec.add_development_dependency 'codeclimate-test-reporter'
30
- spec.add_development_dependency 'simplecov'
31
- spec.add_development_dependency 'pry'
32
29
  end
data/docs/index.rst ADDED
@@ -0,0 +1,88 @@
1
+ CommonMarker+Rouge
2
+ ##################
3
+
4
+ |RubyGems| |GitLab| |GitHub| |Bitbucket| |Gitea|
5
+
6
+ A CommonMarker_ wrapper with syntax highlight support by Rouge_.
7
+
8
+ .. important::
9
+ ``commonmarker-rouge`` currently works only with renderer in ``:UNSAFE`` mode.
10
+ Don't forget to set ``:UNSAFE`` manually if you're overwriting the renderer mode.
11
+
12
+ Installation
13
+ ============
14
+
15
+ Add these lines to your application's Gemfile:
16
+
17
+ .. code-block:: ruby
18
+
19
+ gem 'commonmarker-rouge'
20
+
21
+ Usage
22
+ =====
23
+
24
+ Review the CommonMarker options to understand how to use the ``render_html`` command:
25
+
26
+ * 1st parameter (optional) - `parse options`_
27
+ * 2nd parameter (optional) - `render options`_
28
+ * 3rd parameter (optional) - `extensions`_
29
+
30
+ .. code-block:: ruby
31
+
32
+ # use default CommonMarker class and Rouge::Formatters::HTML formatter
33
+ CommonMarker::Rouge.render_html(content)
34
+
35
+ # Basic examples with 1st and 2nd optional parameters
36
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:UNSAFE])
37
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:SOURCEPOS])
38
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:UNSAFE, :SOURCEPOS])
39
+
40
+ # use GitHub extensions - both 1st/2nd parameters required
41
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:DEFAULT], [:table])
42
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:DEFAULT], [:table, :strikethrough])
43
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:DEFAULT], [:table, :strikethrough, :autolink])
44
+ CommonMarker::Rouge.render_html(content, [:DEFAULT], [:DEFAULT], [:table, :strikethrough, :tagfilter])
45
+
46
+ # get CommonMarker parsed AST
47
+ CommonMarker::Rouge.render_doc(content)
48
+
49
+ # use custom CommonMarker wrapper (must provide compatible render_doc)
50
+ CommonMarker::Rouge.render_html(content, cmark_class: CommonMarkerWrapper)
51
+
52
+ # use custom Rouge formatter by class
53
+ CommonMarker::Rouge.render_html(content, formatter_class: Rouge::Formatters::HTMLLinewise)
54
+ # or by instance
55
+ CommonMarker::Rouge.render_html(content, formatter: Rouge::Formatters::HTMLTable.new(
56
+ Rouge::Formatters::HTML.new
57
+ ))
58
+
59
+ # pass some options to Rouge
60
+ CommonMarker::Rouge.render_html(content, options: { css_class: 'custom-class' })
61
+ # or
62
+ CommonMarker::Rouge.render_html(content, formatter: Rouge::Formatters::HTMLTable.new(
63
+ Rouge::Formatters::HTML.new, code_class: 'rouge-code'
64
+ ))
65
+
66
+ License
67
+ =======
68
+
69
+ The gem is available as open source under the terms of the `MIT License`_.
70
+
71
+ .. _CommonMarker: https://rubygems.org/gems/commonmarker
72
+ .. _Rouge: https://rubygems.org/gems/rouge
73
+ .. _MIT License: http://opensource.org/licenses/MIT
74
+
75
+ .. _parse options: https://github.com/gjtorikian/commonmarker#parse-options
76
+ .. _render options: https://github.com/gjtorikian/commonmarker#render-options
77
+ .. _extensions: https://github.com/gjtorikian/commonmarker#extensions
78
+
79
+ .. |RubyGems| image:: https://img.shields.io/gem/v/commonmarker-rouge.svg?style=flat-square
80
+ :target: https://rubygems.org/gems/commonmarker-rouge
81
+ .. |GitHub| image:: https://img.shields.io/badge/get%20on-GitHub-informational.svg?style=flat-square&logo=github
82
+ :target: https://github.com/arokettu/commonmarker-rouge
83
+ .. |GitLab| image:: https://img.shields.io/badge/get%20on-GitLab-informational.svg?style=flat-square&logo=gitlab
84
+ :target: https://gitlab.com/sandfox/commonmarker-rouge
85
+ .. |Bitbucket| image:: https://img.shields.io/badge/get%20on-Bitbucket-informational.svg?style=flat-square&logo=bitbucket
86
+ :target: https://bitbucket.org/sandfox/commonmarker-rouge
87
+ .. |Gitea| image:: https://img.shields.io/badge/get%20on-Gitea-informational.svg?style=flat-square&logo=gitea
88
+ :target: https://sandfox.org/sandfox/commonmarker-rouge
@@ -1,5 +1,5 @@
1
1
  module CommonMarker
2
2
  module Rouge
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker-rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Smirnov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-01 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '1.10'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '4'
42
+ version: '5'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,35 +49,41 @@ dependencies:
49
49
  version: '1.10'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '4'
52
+ version: '5'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: bundler
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '1.11'
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - "~>"
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '1.11'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rake
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - "~>"
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '12.0'
74
+ - - "<"
75
+ - !ruby/object:Gem::Version
76
+ version: '14'
74
77
  type: :development
75
78
  prerelease: false
76
79
  version_requirements: !ruby/object:Gem::Requirement
77
80
  requirements:
78
- - - "~>"
81
+ - - ">="
79
82
  - !ruby/object:Gem::Version
80
83
  version: '12.0'
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: '14'
81
87
  - !ruby/object:Gem::Dependency
82
88
  name: rspec
83
89
  requirement: !ruby/object:Gem::Requirement
@@ -92,73 +98,33 @@ dependencies:
92
98
  - - "~>"
93
99
  - !ruby/object:Gem::Version
94
100
  version: '3.0'
95
- - !ruby/object:Gem::Dependency
96
- name: codeclimate-test-reporter
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '0'
109
- - !ruby/object:Gem::Dependency
110
- name: simplecov
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- version: '0'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- version: '0'
123
- - !ruby/object:Gem::Dependency
124
- name: pry
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- version: '0'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: '0'
137
- description:
101
+ description:
138
102
  email:
139
- - sandfox@sandfox.me
103
+ - sandfox+gem@sandfox.me
140
104
  executables: []
141
105
  extensions: []
142
106
  extra_rdoc_files: []
143
107
  files:
144
108
  - ".gitignore"
109
+ - ".gitlab-ci.yml"
145
110
  - ".rspec"
146
- - ".travis.yml"
147
111
  - CHANGELOG.md
148
112
  - Gemfile
113
+ - Gemfile.lowest
149
114
  - LICENSE.md
150
115
  - README.md
151
116
  - Rakefile
152
117
  - bin/console
153
118
  - bin/setup
154
119
  - commonmarker-rouge.gemspec
120
+ - docs/index.rst
155
121
  - lib/commonmarker/rouge.rb
156
122
  - lib/commonmarker/rouge/version.rb
157
- homepage: https://github.com/sandfoxme/commonmarker-rouge
123
+ homepage: https://sandfox.dev/ruby/commonmarker-rouge.html
158
124
  licenses:
159
125
  - MIT
160
126
  metadata: {}
161
- post_install_message:
127
+ post_install_message:
162
128
  rdoc_options: []
163
129
  require_paths:
164
130
  - lib
@@ -173,9 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
139
  - !ruby/object:Gem::Version
174
140
  version: '0'
175
141
  requirements: []
176
- rubyforge_project:
177
- rubygems_version: 2.6.12
178
- signing_key:
142
+ rubygems_version: 3.4.10
143
+ signing_key:
179
144
  specification_version: 4
180
145
  summary: CommonMarker wrapper with Rouge syntax highlighter
181
146
  test_files: []
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- dist: trusty
3
- rvm:
4
- - '2.0'
5
- - '2.4'
6
- - '2.5'
7
- - ruby-head
8
- before_install: gem install bundler
9
- script: bundle exec rspec && if [ -d coverage ]; then bundle exec codeclimate-test-reporter; fi