vimwiki_markdown 0.6.0 → 0.7.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 +4 -4
- data/.travis.yml +5 -3
- data/A.png +0 -0
- data/B.png +0 -0
- data/README.md +9 -0
- data/lib/vimwiki_markdown/options.rb +2 -1
- data/lib/vimwiki_markdown/version.rb +1 -1
- data/lib/vimwiki_markdown/vimwiki_link.rb +6 -1
- data/spec/lib/vimwiki_markdown/options_spec.rb +5 -0
- data/spec/lib/vimwiki_markdown/vimwiki_link_spec.rb +11 -0
- data/vimwiki_markdown.gemspec +1 -1
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4893e1d18542936cff19882c791e51c9d8234cefaaec3751cff7fc9724eb70e
|
4
|
+
data.tar.gz: 1e51ef4d9df34eb09ad1cf0528efad3b3471e11790a3628594b27224e1560176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4301871b6d662d7f02c8c549dcdcd239633183f4bfb9a05f3c04c6d40405778da03ef88948a1d954a0d6b6b41c2c4df3a43602f2d3673108cbf1402b484442e
|
7
|
+
data.tar.gz: 908c6005ba6107459aa00297331a62eac008ccc88e4feb526943225d01dd6bdbd21307db1466303424a9fb0378c03cd29f7ca6a586b1274e82b39264739728d1
|
data/.travis.yml
CHANGED
data/A.png
ADDED
Binary file
|
data/B.png
ADDED
Binary file
|
data/README.md
CHANGED
@@ -6,6 +6,15 @@ to be converted to HTML.
|
|
6
6
|
|
7
7
|
It is currently a work in progress (but working for me ;)
|
8
8
|
|
9
|
+
## Example
|
10
|
+
It turns this:
|
11
|
+
|
12
|
+

|
13
|
+
|
14
|
+
into
|
15
|
+
|
16
|
+

|
17
|
+
|
9
18
|
## Requirements
|
10
19
|
|
11
20
|
Ruby installed on your computer & up to date version of vimwiki
|
@@ -34,7 +34,12 @@ module VimwikiMarkdown
|
|
34
34
|
def rewrite_local_links!
|
35
35
|
if vimwiki_markdown_file_exists?
|
36
36
|
path = Pathname.new(uri)
|
37
|
-
|
37
|
+
|
38
|
+
link_path = path.basename(markdown_extension).to_s.parameterize
|
39
|
+
|
40
|
+
link_path = path.basename(markdown_extension).to_s if link_path.match(/^\s*$/)
|
41
|
+
|
42
|
+
@uri = "#{path.dirname + link_path}.html"
|
38
43
|
@fragment = fragment.parameterize.prepend("#") unless fragment.empty?
|
39
44
|
elsif /^file:/.match(uri)
|
40
45
|
# begins with file: -> force absolute path if file exists
|
@@ -43,6 +43,11 @@ module VimwikiMarkdown
|
|
43
43
|
expect(Options.new.output_fullpath).to eq("#{subject.output_dir}name-with-spaces.html")
|
44
44
|
end
|
45
45
|
|
46
|
+
it "must not change filenames if paramteriezed returns an empty string" do
|
47
|
+
allow_any_instance_of(Options).to receive(:input_file) { "~/foo/世界.md" }
|
48
|
+
expect(Options.new.output_fullpath).to eq("#{subject.output_dir}世界.html")
|
49
|
+
end
|
50
|
+
|
46
51
|
it "must correctly deal with filenames with capitalization issues" do
|
47
52
|
allow_any_instance_of(Options).to receive(:input_file) { "~/foo/NAME WITH SPACES.md" }
|
48
53
|
expect(Options.new.output_fullpath).to eq("#{subject.output_dir}name-with-spaces.html")
|
@@ -68,6 +68,17 @@ module VimwikiMarkdown
|
|
68
68
|
expect(link.to_s).to eq("[test](#{existing_file_no_extension}.html#wiki-heading)")
|
69
69
|
end
|
70
70
|
|
71
|
+
context "with chinese or unparamaterizable chars" do
|
72
|
+
let(:existing_file) { "世界#{markdown_extension}" }
|
73
|
+
|
74
|
+
it "must convert same-directory markdown links without paramaterization correctly" do
|
75
|
+
markdown_link = "[test](#{existing_file_no_extension})"
|
76
|
+
|
77
|
+
link = VimwikiLink.new(markdown_link, source_filepath, markdown_extension, root_path, output_dir)
|
78
|
+
expect(link.to_s).to eq("[test](#{existing_file_no_extension}.html)")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
71
82
|
context "subdirectory linked files" do
|
72
83
|
let(:existing_file) { "subdirectory/test.md" }
|
73
84
|
|
data/vimwiki_markdown.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler"
|
21
|
+
spec.add_development_dependency "bundler"
|
22
22
|
spec.add_development_dependency "rake", "~> 12.3"
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
24
|
spec.add_development_dependency "pry", "~> 0.12"
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimwiki_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.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:
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,6 +220,8 @@ files:
|
|
220
220
|
- ".rspec"
|
221
221
|
- ".rubocop.yml"
|
222
222
|
- ".travis.yml"
|
223
|
+
- A.png
|
224
|
+
- B.png
|
223
225
|
- Gemfile
|
224
226
|
- Guardfile
|
225
227
|
- LICENSE.txt
|
@@ -245,7 +247,7 @@ homepage: https://github.com/patrickdavey/wimwiki_markdown
|
|
245
247
|
licenses:
|
246
248
|
- MIT
|
247
249
|
metadata: {}
|
248
|
-
post_install_message:
|
250
|
+
post_install_message:
|
249
251
|
rdoc_options: []
|
250
252
|
require_paths:
|
251
253
|
- lib
|
@@ -260,8 +262,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
262
|
- !ruby/object:Gem::Version
|
261
263
|
version: '0'
|
262
264
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
264
|
-
signing_key:
|
265
|
+
rubygems_version: 3.2.3
|
266
|
+
signing_key:
|
265
267
|
specification_version: 4
|
266
268
|
summary: Converts a github flavoured markdown vimwiki file into html.
|
267
269
|
test_files:
|