vimwiki_markdown 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 726b831c9bb819ebbe7bd054e85d47926d008142
4
- data.tar.gz: 2fc210b9ee34a717e9ea98b51122f646e1e8629f
3
+ metadata.gz: 906fabd0c29669e95009a6d932f85972836e245b
4
+ data.tar.gz: 2dcb95b6af6aee3c52998f5fa336129f87edfecf
5
5
  SHA512:
6
- metadata.gz: aa137e60a6d1e2e53ee2f0a46a55b14de20971ddb29d31eafe182adb3b9dd4a228596fb8210d9b2f3ce2f56e8b9d81db14220f15c2d3407074cb013151ff37c8
7
- data.tar.gz: d71c4e2e0ff8e45d2dac61f6c3ebd1de3bfe4e784880113becaeb13ec06302a9db09ef5eb0265ff097478ead5378c8c31434707b692cc169e11d1fe1cda25aa2
6
+ metadata.gz: 6970110fe34db2557327ead5bc447075f18904977047bb08686be834a3ded04622927e7665d5ab28f69241e1ec12bf7b4efe9488045d1eb58a1d93563a964475
7
+ data.tar.gz: dc78376885a59561e34b1d9d3dd2e0aa692efe4c7ef053032231b29b4ced5c59c53345e86a961756113f6a8aca7c6246799ac45e50915bee9dd72c44c9471227
data/README.md CHANGED
@@ -28,10 +28,6 @@ this we use the custom_wiki2html parameter. My .vimrc looks like this:
28
28
 
29
29
  The most important part is the *'custom_wiki2html': 'vimwiki_markdown'*
30
30
 
31
- ### Note for ruby 2.2
32
- This gem doesn't seem to work on 2.2 on osx.. seems to be a github/markup gem issue as near as I can tell.
33
- For the moment.. use 2.1 or lower if you run into issues.
34
-
35
31
  ### Fix for vimwiki links.
36
32
  In vimwiki at the moment, it deletes any files in the site_html directory which do not match
37
33
  against the markdown files (once they are translated into linked html). Now, in vimwiki_markdown
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.1 [December 15th 2016]
2
+ Allow %root_path% substitution in template file.
3
+
1
4
  ## 0.2.0 [March 6th 2016]
2
5
  * Adds the ability for `[[source|title]]` style links to be parsed correctly
3
6
  * Allows links with subdirectories `[[path/in/a/subdir/file]]` links to work
@@ -26,6 +26,7 @@ module VimwikiMarkdown
26
26
 
27
27
  def fixtags(template)
28
28
  @template = template.gsub('%title%',title).gsub('%pygments%',pygments_wrapped_in_tags)
29
+ @template = @template.gsub('%root_path%', root_path)
29
30
  end
30
31
 
31
32
  def pygments_wrapped_in_tags
@@ -34,6 +35,10 @@ module VimwikiMarkdown
34
35
  </style>"
35
36
  end
36
37
 
38
+ def root_path
39
+ options.root_path
40
+ end
41
+
37
42
  def title
38
43
  options.title
39
44
  end
@@ -1,3 +1,3 @@
1
1
  module VimwikiMarkdown
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -30,5 +30,19 @@ module VimwikiMarkdown
30
30
  expect { Template.new(options).to_s }.to raise_exception(MissingRequiredParamError)
31
31
  end
32
32
  end
33
+
34
+ context "using %root_path%" do
35
+ before do
36
+ allow(Options).to receive(:arguments).and_return(Options::DEFAULTS)
37
+ end
38
+
39
+ it "correctly substitute %root_path%" do
40
+ allow(File).to receive(:open).with(options.template_filename,"r").and_return(StringIO.new(wiki_template))
41
+
42
+ rendered_template = Template.new(options).to_s
43
+ expect(rendered_template).not_to include("%root_path%")
44
+ expect(rendered_template).to include("./rootStyle.css")
45
+ end
46
+ end
33
47
  end
34
48
  end
data/spec/spec_helper.rb CHANGED
@@ -121,6 +121,10 @@ def wiki_template
121
121
  <link type="text/css" rel="stylesheet" href="./overrides.css" />
122
122
  <link type="text/css" rel="stylesheet" href="./styles/shCore.css" />
123
123
  <link type="text/css" rel="stylesheet" href="./styles/shThemeDefault.css" />
124
+
125
+ <!-- for testing %ROOT_PATH% substitutions -->
126
+ <link type="text/css" rel="stylesheet" href="%root_path%/rootStyle.css" />
127
+
124
128
  <script type="text/javascript" src="./scripts/shCore.js"></script>
125
129
  <script type="text/javascript" src="./scripts/shBrushRuby.js"></script>
126
130
  <script type="text/javascript" src="./scripts/shObjectiveC.js"></script>
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Davey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-05 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  version: '0'
245
245
  requirements: []
246
246
  rubyforge_project:
247
- rubygems_version: 2.4.8
247
+ rubygems_version: 2.5.1
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Converts a github flavoured markdown vimwiki file into html.
@@ -254,3 +254,4 @@ test_files:
254
254
  - spec/lib/vimwiki_markdown/vimwiki_link_spec.rb
255
255
  - spec/lib/vimwiki_markdown/wiki_body_spec.rb
256
256
  - spec/spec_helper.rb
257
+ has_rdoc: