zenweb 3.10.6 → 3.10.8

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: 68ee34c1081020cb2d941c8274ab68d94134e50fc7b67330335d8e030d1f3177
4
- data.tar.gz: e22b30eee01734adf91e2b8bdd5ba5ffbe4d962447c35089ccee3d7920f3289b
3
+ metadata.gz: 448821783e1068f92a0284e93d3072d8501cf21cc0ab94da3f6fc63d251de7d0
4
+ data.tar.gz: 314bda2c7bc1882f01e5c7b5ff37da023dc46bfd7e0b73de67e605f7260e20f0
5
5
  SHA512:
6
- metadata.gz: 574f8c47d35ab0070a6f64509b21a525c68789d2cb9b28c1fe4bcb735c0ce187afbd835711e896fbaddb1dc07b480e22dc32d7a658b94541390d9548fbba4c62
7
- data.tar.gz: f5620b48cb0ff5c203d32b8902740d1a936fe46c8cf6a8946a0cfaf4e63cbf7fdf7f03e51e094ac5696b877846ca8a40c85bc1df79975ba2fae0d2d20f0c1c30
6
+ metadata.gz: d4753d177c0ab4b46a58e929f57e1d1c26fcda263c24aa7cc2d0b7875b2b13a2103903664af997a2c15b8903ce7d2d74dc9a13838947338c7ef4d5e45f4602de
7
+ data.tar.gz: 0d59fdbee4361cce03ef42aac407a39dd25ee2a4a025964de78ab50b5b68ef070d2a54c1b8ef95d0b03d0c07785606978f19367cbd8beeba3c046c17990c3c84
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,3 +1,15 @@
1
+ === 3.10.8 / 2023-08-30
2
+
3
+ * 1 bug fix:
4
+
5
+ * Fixed configuration of no_line_numbers for kramdown v2 changes
6
+
7
+ === 3.10.7 / 2023-07-25
8
+
9
+ * 1 minor enhancement:
10
+
11
+ * Updated to use kramdown 2.x + kramdown-syntax-coderay + kramdown-parser-gfm.
12
+
1
13
  === 3.10.6 / 2023-05-04
2
14
 
3
15
  * 1 bug fix:
data/Manifest.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  .autotest
2
- History.txt
2
+ History.rdoc
3
3
  Manifest.txt
4
- README.txt
4
+ README.rdoc
5
5
  Rakefile
6
6
  example-site/.isolate.rb
7
7
  example-site/Rakefile
data/Rakefile CHANGED
@@ -9,11 +9,17 @@ Hoe.plugin :isolate
9
9
  Hoe.spec 'zenweb' do
10
10
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
11
11
 
12
+ license "MIT"
13
+
12
14
  dependency "rake", [">= 0.9", "< 15"]
13
15
  dependency "makerakeworkwell", "~> 1.0"
14
16
  dependency "less", "~> 2.0"
17
+
15
18
  dependency "coderay", "~> 1.0"
16
- dependency "kramdown", "~> 1.4" # TODO: 1.17.0 -> 2.1.0
19
+
20
+ dependency "kramdown", "~> 2.0"
21
+ dependency "kramdown-syntax-coderay", "~> 1.0"
22
+ dependency "kramdown-parser-gfm", "~> 1.0"
17
23
  end
18
24
 
19
25
  # vim: syntax=ruby
@@ -1,13 +1,18 @@
1
1
  class Zenweb::Page
2
2
  KRAMDOWN_CONFIG = { # :nodoc:
3
- :toc_levels => '2..4',
4
-
3
+ :toc_levels => 2..4,
5
4
  :entity_output => :symbolic,
6
-
7
- :coderay_wrap => :div,
8
- :coderay_line_numbers => :table,
9
- :coderay_tab_width => 4,
10
- :coderay_css => :class,
5
+ :hard_wrap => false,
6
+ :input => "GFM",
7
+ :gfm_quirks => "no_auto_typographic",
8
+
9
+ :syntax_highlighter => :coderay,
10
+ :syntax_highlighter_opts => {
11
+ :wrap => :div,
12
+ :line_numbers => :table,
13
+ :tab_width => 4,
14
+ :css => :class,
15
+ },
11
16
  }
12
17
 
13
18
  ##
@@ -30,14 +35,15 @@ class Zenweb::Page
30
35
 
31
36
  def markdown content, no_line_numbers = false
32
37
  require "kramdown"
38
+ require "kramdown-parser-gfm"
39
+ require "kramdown-syntax-coderay"
33
40
  require "coderay/zenweb_extensions"
34
41
 
35
- content = content.
36
- gsub(/^\`\`\` *(\w+)/) { "~~~ #$1" }.
37
- gsub(/^\`\`\`/, '~~~')
38
-
39
42
  config = KRAMDOWN_CONFIG.dup
40
- config[:coderay_line_numbers] = nil if no_line_numbers
43
+ if no_line_numbers then
44
+ config[:syntax_highlighter_opts] = config[:syntax_highlighter_opts].dup
45
+ config[:syntax_highlighter_opts][:line_numbers] = nil
46
+ end
41
47
 
42
48
  Kramdown::Document.new(content, config).to_html
43
49
  end
data/lib/zenweb.rb CHANGED
@@ -6,7 +6,7 @@ require "time"
6
6
 
7
7
  module Zenweb
8
8
  # duh
9
- VERSION = "3.10.6"
9
+ VERSION = "3.10.8"
10
10
  end
11
11
 
12
12
  require "zenweb/site"
@@ -18,8 +18,8 @@ class MarkdownTest < Minitest::Test
18
18
  end
19
19
 
20
20
  class TestUgh < MarkdownTest
21
- def assert_markdown_code lang, line, *exps
22
- act = page.markdown "``` #{lang}\n#{line}\n```"
21
+ def assert_markdown_code lang, line, *exps, no_lineno: false
22
+ act = page.markdown "``` #{lang}\n#{line}\n```", no_lineno
23
23
 
24
24
  exps.each do |exp|
25
25
  assert_includes act, exp, act
@@ -33,6 +33,14 @@ class TestUgh < MarkdownTest
33
33
  '<span class="keyword">def</span>')
34
34
  end
35
35
 
36
+ def test_coderay_ruby__no_line_numbers
37
+ assert_markdown_code("ruby",
38
+ "def x\n 42\nend",
39
+ '<div class="language-ruby highlighter-coderay"><div class="CodeRay">',
40
+ '<span class="keyword">def</span>',
41
+ no_lineno: true)
42
+ end
43
+
36
44
  def test_coderay_clojure
37
45
  assert_markdown_code("clojure",
38
46
  "(+ 1 1)",
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zenweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.6
4
+ version: 3.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
30
30
  nsNBRuQJ1UfiCG97a6DNm+Fr
31
31
  -----END CERTIFICATE-----
32
- date: 2023-05-05 00:00:00.000000000 Z
32
+ date: 2023-08-30 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -99,14 +99,42 @@ dependencies:
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '1.4'
102
+ version: '2.0'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '2.0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: kramdown-syntax-coderay
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '1.0'
103
117
  type: :runtime
104
118
  prerelease: false
105
119
  version_requirements: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '1.4'
123
+ version: '1.0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: kramdown-parser-gfm
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1.0'
131
+ type: :runtime
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.0'
110
138
  - !ruby/object:Gem::Dependency
111
139
  name: rdoc
112
140
  requirement: !ruby/object:Gem::Requirement
@@ -160,9 +188,9 @@ email:
160
188
  executables: []
161
189
  extensions: []
162
190
  extra_rdoc_files:
163
- - History.txt
191
+ - History.rdoc
164
192
  - Manifest.txt
165
- - README.txt
193
+ - README.rdoc
166
194
  - example-site/about/index.html.md
167
195
  - example-site/blog/2012-01-02-page1.html.md
168
196
  - example-site/blog/2012-01-03-page2.html.md
@@ -172,9 +200,9 @@ extra_rdoc_files:
172
200
  - example-site/pages/nonblogpage.html.md
173
201
  files:
174
202
  - ".autotest"
175
- - History.txt
203
+ - History.rdoc
176
204
  - Manifest.txt
177
- - README.txt
205
+ - README.rdoc
178
206
  - Rakefile
179
207
  - example-site/.isolate.rb
180
208
  - example-site/Rakefile
@@ -241,7 +269,7 @@ metadata:
241
269
  post_install_message:
242
270
  rdoc_options:
243
271
  - "--main"
244
- - README.txt
272
+ - README.rdoc
245
273
  require_paths:
246
274
  - lib
247
275
  required_ruby_version: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- xm�i��U~ke�@����W7�4$�V���u���h<�!c����Ope���"��v�޷�5��� ��
2
- +
1
+ W��F\:�:Nڌ�=(:�� AKi�^*��=��A zr���^�ӧK[2����I��
File without changes