soywiki 0.9.4 → 0.9.5

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.
Files changed (4) hide show
  1. data/lib/soywiki.rb +1 -1
  2. data/lib/soywiki.vim +24 -4
  3. data/soywiki.gemspec +10 -0
  4. metadata +7 -4
data/lib/soywiki.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'string_ext'
2
2
  module Template_Substitution; end
3
3
  module Soywiki
4
- VERSION = '0.9.4'
4
+ VERSION = '0.9.5'
5
5
  WIKI_WORD = /\b([a-z0-9][\w_]+\.)?[A-Z][a-z]+[A-Z0-9]\w*\b/
6
6
  HYPERLINK = %r|\bhttps?://[^ >)\n\]]+|
7
7
 
data/lib/soywiki.vim CHANGED
@@ -5,6 +5,7 @@
5
5
  if exists("g:SoyWikiLoaded") || &cp || version < 700
6
6
  finish
7
7
  endif
8
+
8
9
  let g:SoyWikiLoaded = 1
9
10
 
10
11
  let mapleader = ','
@@ -26,7 +27,15 @@ func! s:trimString(string)
26
27
  endfunc
27
28
 
28
29
  func! s:page_title()
29
- return substitute(bufname(''), '\/', '.', '')
30
+ let path = s:wiki_root()
31
+ let raw_title = substitute(expand('%:p'), path, '', '')
32
+ let page_title = substitute(raw_title, '\/', '.', '')
33
+ return page_title
34
+ endfunc
35
+
36
+ func! s:wiki_root()
37
+ let root_path = split(system("git rev-parse --show-toplevel"), "\n")[0] . '/'
38
+ return root_path
30
39
  endfunc
31
40
 
32
41
  func! s:display_missing_namespace_error(num_segments, page_title)
@@ -52,6 +61,12 @@ func! s:namespace_of_title(page_title)
52
61
  endif
53
62
  endfunc
54
63
 
64
+ func! s:namespace_path_of_title(page_title)
65
+ let namespace = s:namespace_of_title(a:page_title)
66
+ let root_path = s:wiki_root()
67
+ return root_path . namespace
68
+ endfunc
69
+
55
70
  func! s:page_namespace()
56
71
  return s:namespace_of_title(s:page_title())
57
72
  endfunc
@@ -89,11 +104,15 @@ func! s:is_wiki_page()
89
104
  endfunc
90
105
 
91
106
  func! s:pagetitle2file(page)
92
- return substitute(a:page, '\.', '/', 'g')
107
+ let path = s:wiki_root()
108
+ let filepath = path . substitute(a:page, '\.', '/', 'g')
109
+ return filepath
93
110
  endfunc
94
111
 
95
112
  func! s:filename2pagetitle(page)
96
- return substitute(a:page, '/', '.', 'g')
113
+ let path = s:wiki_root()
114
+ let title = substitute(substitute(a:page, path, '', 'g'), '/', '.', 'g')
115
+ return title
97
116
  endfunc
98
117
 
99
118
  func! s:list_pages()
@@ -201,7 +220,8 @@ func! s:load_page(page, split)
201
220
  if namespace == ""
202
221
  return
203
222
  end
204
- call system("mkdir -p " . namespace)
223
+ let namespace_path = s:namespace_path_of_title(a:page)
224
+ call system("mkdir -p " . namespace_path)
205
225
  call writefile([title, '', ''], file)
206
226
  endif
207
227
  if (a:split == 2)
data/soywiki.gemspec CHANGED
@@ -19,6 +19,16 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
+ additional_info = <<-INFO
23
+ For optional compilation of the wiki to html you will need:
24
+ - haml
25
+ and for markdown support:
26
+ - rdiscount
27
+ INFO
28
+
29
+ s.requirements = additional_info
30
+ s.post_install_message = additional_info
31
+
22
32
  #s.add_dependency 'haml'
23
33
  #s.add_dependency 'rdiscount'
24
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soywiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-02 00:00:00.000000000 Z
12
+ date: 2013-08-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A personal and collaborative wiki for Vim users
15
15
  email:
@@ -45,7 +45,8 @@ files:
45
45
  - soywiki.gemspec
46
46
  homepage: http://danielchoi.com/software/soywiki.html
47
47
  licenses: []
48
- post_install_message:
48
+ post_install_message: ! "For optional compilation of the wiki to html you will need:\n
49
+ - haml\nand for markdown support:\n - rdiscount\n"
49
50
  rdoc_options: []
50
51
  require_paths:
51
52
  - lib
@@ -61,7 +62,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
62
  - - ! '>='
62
63
  - !ruby/object:Gem::Version
63
64
  version: '0'
64
- requirements: []
65
+ requirements:
66
+ - ! "For optional compilation of the wiki to html you will need:\n - haml\nand for
67
+ markdown support:\n - rdiscount\n"
65
68
  rubyforge_project: soywiki
66
69
  rubygems_version: 1.8.23
67
70
  signing_key: