vimwiki_markdown 0.8.2 → 0.9.0

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: 7c9f4165d6c964688b29b13f05378ad2d7f8aa04621121e718e3bf25a9832ecc
4
- data.tar.gz: d76fa5a6a5081ff3cde0e8d556bca8e45e90f25618ad4b623e0949c88ed18e5b
3
+ metadata.gz: 339d2e69a0cf1092eee83e9ac396e8dea9a8890a84aa4a1e48951d2239790def
4
+ data.tar.gz: 9a7615397fbfbc1a419b2f40037a6c151c0f4534e07d57ec39f902dc88dbbd68
5
5
  SHA512:
6
- metadata.gz: 909ccbcc5420b3da2b2c62d40bf5e6f8223afdd2044386f33809598d741cb19ae197d728f22bff724fd99c2d109feb917fc862287a61ab22004ee50486b0ce93
7
- data.tar.gz: 1ed5e03a0811ce63df21004ae8f10020a6d8fd758280d6cc0e6dca353ab49431190cf9f23d9ff230713e9285cf69231d314a7bfcd7fa8e681e889d2ba6b634af
6
+ metadata.gz: a2f9dbb62a7013d67b380b96d72bac6f57e2fcc87cf2388bd501eb7365cffc897750e462bb5d2c8bc95ef1d6d88bb4f0d5cb6d230f0f4f9dc6e46641d9fdc916
7
+ data.tar.gz: 80e2a9e2b9bb507e65147530dd4c21737f2d3195ab9d1dceca15bdf5fa697dafca40eb1f9b56a9b9dd5b25f772f722b93aa9a1db6f356bde88004b0ddb8d2879
data/.rubocop.yml CHANGED
@@ -16,15 +16,12 @@ Style/SymbolArray:
16
16
  Style/SafeNavigation:
17
17
  Enabled: false
18
18
 
19
- Layout/IndentHeredoc:
19
+ Layout/HeredocIndentation:
20
20
  Enabled: false
21
21
 
22
22
  Layout/FirstParameterIndentation:
23
23
  EnforcedStyle: consistent
24
24
 
25
- Rails/DynamicFindBy:
26
- Enabled: false
27
-
28
25
  Layout/EmptyLines:
29
26
  Enabled: false
30
27
 
data/.travis.yml CHANGED
@@ -3,9 +3,7 @@ before_install:
3
3
  - gem install bundler -v '< 2'
4
4
  language: ruby
5
5
  rvm:
6
- - 2.3.8
7
- - 2.4.10
8
- - 2.5.8
9
- - 2.6.6
10
- - 2.7.2
11
- - 3.0.0
6
+ - 2.7.8
7
+ - 3.0.6
8
+ - 3.1.4
9
+ - 3.2.2
data/README.md CHANGED
@@ -49,7 +49,7 @@ It is a requirement that your template file contain a placeholder
49
49
  for the syntax highlighting code to be placed. In order to do this,
50
50
  open up your default.tpl (or whatever your template file is called)
51
51
  and ensure that before the closing </head> tag you put
52
- `%pygments%`
52
+ `%pygments%`. You also have the option to put `%dark_pygments%` if you want to have "dark mode" syntax highlighting.
53
53
 
54
54
  A sample tpl file is available here https://raw.githubusercontent.com/patrickdavey/vimwiki_markdown/master/example_files/default.tpl
55
55
 
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.9.0 [02 April 2023]
2
+ Add support for dark mode. Drop support for ruby < 2.7
3
+
1
4
  ## 0.8.2 [22 June 2022]
2
5
  Remove deprecation warning for EscapeUtils.escape_html
3
6
  see https://github.com/patrickdavey/vimwiki_markdown/pull/43
@@ -33,6 +33,8 @@ module VimwikiMarkdown
33
33
  end
34
34
 
35
35
  def pygments_wrapped_in_tags
36
+ Rouge::Themes::Github.dark! if dark_template?
37
+
36
38
  "<style type=\"text/css\">
37
39
  #{::Rouge::Themes::Github.render(scope: '.highlight')}
38
40
  </style>"
@@ -47,7 +49,17 @@ module VimwikiMarkdown
47
49
  end
48
50
 
49
51
  def validate_template
50
- raise MissingRequiredParamError.new("ERROR: vimwiki template must contain %pygments% placeholder token. Please visit https://github.com/patrickdavey/vimwiki_markdown for more information") unless @template =~ /%pygments%/
52
+ return if dark_template? || regular_template?
53
+
54
+ raise MissingRequiredParamError.new("ERROR: vimwiki template must contain %pygments% placeholder token. Please visit https://github.com/patrickdavey/vimwiki_markdown for more information")
55
+ end
56
+
57
+ def dark_template?
58
+ @template =~ /%dark_pygments%/
59
+ end
60
+
61
+ def regular_template?
62
+ @template =~ /%pygments%/
51
63
  end
52
64
  end
53
65
  end
@@ -1,3 +1,3 @@
1
1
  module VimwikiMarkdown
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -32,6 +32,18 @@ module VimwikiMarkdown
32
32
  end
33
33
  end
34
34
 
35
+ context "dark pygments" do
36
+ before do
37
+ allow(Options).to receive(:arguments).and_return(Options::DEFAULTS)
38
+ end
39
+
40
+ it "should raise an invalid exception for missing pygments" do
41
+ allow(File).to receive(:open).with(options.template_filename, "r").and_return(StringIO.new(dark_pygments))
42
+ expect(Rouge::Themes::Github).to receive(:dark!) { true }
43
+ Template.new(options).to_s
44
+ end
45
+ end
46
+
35
47
  context "using %root_path%" do
36
48
  before do
37
49
  allow(Options).to receive(:arguments).and_return(Options::DEFAULTS)
data/spec/spec_helper.rb CHANGED
@@ -184,5 +184,9 @@ WIKITEMPLATE
184
184
  end
185
185
 
186
186
  def template_missing_pygments
187
- wiki_template.gsub!('%pygments%','')
187
+ wiki_template.gsub!("%pygments%", "")
188
+ end
189
+
190
+ def dark_pygments
191
+ wiki_template.gsub!("%pygments%", "%dark_pygments%")
188
192
  end
@@ -12,25 +12,26 @@ Gem::Specification.new do |spec|
12
12
  spec.description = %q{Converts a vimwiki markdown file to html. It parses [[links]] and has support for syntax highlighting.}
13
13
  spec.homepage = "https://github.com/patrickdavey/wimwiki_markdown"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = '>= 2.3.8'
15
+ spec.required_ruby_version = ">= 2.7"
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler"
22
+ spec.add_development_dependency "guard-rspec", "~> 4.3"
23
+ spec.add_development_dependency "pry", "~> 0.12"
22
24
  spec.add_development_dependency "rake", "~> 12.3"
23
25
  spec.add_development_dependency "rspec", "~> 3.0"
24
- spec.add_development_dependency "pry", "~> 0.12"
25
- spec.add_development_dependency "rspec-its", "~> 1.1"
26
26
  spec.add_development_dependency "rspec-html-matchers", "~> 0.6.1"
27
- spec.add_development_dependency "guard-rspec", "~> 4.3"
27
+ spec.add_development_dependency "rspec-its", "~> 1.1"
28
28
  spec.add_development_dependency "rubocop"
29
+ spec.add_development_dependency "solargraph"
29
30
 
30
31
  spec.add_runtime_dependency "activesupport", "~> 4.1"
31
- spec.add_runtime_dependency "github-markup", "~> 3.0"
32
32
  spec.add_runtime_dependency "commonmarker", "~> 0.23.4"
33
- spec.add_runtime_dependency "html-pipeline", "~> 2.0"
34
- spec.add_runtime_dependency "rouge", "~> 3.3"
35
33
  spec.add_runtime_dependency "escape_utils", "~> 1.2"
34
+ spec.add_runtime_dependency "github-markup", "~> 3.0"
35
+ spec.add_runtime_dependency "html-pipeline", "~> 2.0"
36
+ spec.add_runtime_dependency "rouge", "~> 4.0"
36
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimwiki_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Davey
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-22 00:00:00.000000000 Z
11
+ date: 2023-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,61 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: guard-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: '4.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.3'
40
+ version: '4.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '0.12'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.12'
61
+ version: '12.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.12'
68
+ version: '12.3'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec-its
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.1'
75
+ version: '3.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.1'
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec-html-matchers
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.6.1
97
97
  - !ruby/object:Gem::Dependency
98
- name: guard-rspec
98
+ name: rspec-its
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '4.3'
103
+ version: '1.1'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '4.3'
110
+ version: '1.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: solargraph
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: activesupport
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -137,75 +151,75 @@ dependencies:
137
151
  - !ruby/object:Gem::Version
138
152
  version: '4.1'
139
153
  - !ruby/object:Gem::Dependency
140
- name: github-markup
154
+ name: commonmarker
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: '3.0'
159
+ version: 0.23.4
146
160
  type: :runtime
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: '3.0'
166
+ version: 0.23.4
153
167
  - !ruby/object:Gem::Dependency
154
- name: commonmarker
168
+ name: escape_utils
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - "~>"
158
172
  - !ruby/object:Gem::Version
159
- version: 0.23.4
173
+ version: '1.2'
160
174
  type: :runtime
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: 0.23.4
180
+ version: '1.2'
167
181
  - !ruby/object:Gem::Dependency
168
- name: html-pipeline
182
+ name: github-markup
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: '2.0'
187
+ version: '3.0'
174
188
  type: :runtime
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: '2.0'
194
+ version: '3.0'
181
195
  - !ruby/object:Gem::Dependency
182
- name: rouge
196
+ name: html-pipeline
183
197
  requirement: !ruby/object:Gem::Requirement
184
198
  requirements:
185
199
  - - "~>"
186
200
  - !ruby/object:Gem::Version
187
- version: '3.3'
201
+ version: '2.0'
188
202
  type: :runtime
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: '3.3'
208
+ version: '2.0'
195
209
  - !ruby/object:Gem::Dependency
196
- name: escape_utils
210
+ name: rouge
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
213
  - - "~>"
200
214
  - !ruby/object:Gem::Version
201
- version: '1.2'
215
+ version: '4.0'
202
216
  type: :runtime
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
220
  - - "~>"
207
221
  - !ruby/object:Gem::Version
208
- version: '1.2'
222
+ version: '4.0'
209
223
  description: Converts a vimwiki markdown file to html. It parses [[links]] and has
210
224
  support for syntax highlighting.
211
225
  email:
@@ -248,7 +262,7 @@ homepage: https://github.com/patrickdavey/wimwiki_markdown
248
262
  licenses:
249
263
  - MIT
250
264
  metadata: {}
251
- post_install_message:
265
+ post_install_message:
252
266
  rdoc_options: []
253
267
  require_paths:
254
268
  - lib
@@ -256,15 +270,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
270
  requirements:
257
271
  - - ">="
258
272
  - !ruby/object:Gem::Version
259
- version: 2.3.8
273
+ version: '2.7'
260
274
  required_rubygems_version: !ruby/object:Gem::Requirement
261
275
  requirements:
262
276
  - - ">="
263
277
  - !ruby/object:Gem::Version
264
278
  version: '0'
265
279
  requirements: []
266
- rubygems_version: 3.2.3
267
- signing_key:
280
+ rubygems_version: 3.2.33
281
+ signing_key:
268
282
  specification_version: 4
269
283
  summary: Converts a github flavoured markdown vimwiki file into html.
270
284
  test_files: