soywiki 0.5.8 → 0.5.9
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.
- data/README.markdown +24 -2
- data/bin/soywiki-ls-t +4 -0
- data/lib/soywiki.rb +1 -1
- data/lib/soywiki.vim +22 -5
- metadata +2 -2
data/README.markdown
CHANGED
@@ -105,6 +105,24 @@ or you can `export SOYWIKI_VIM=mvim` in your `~/.bash_profile` and then
|
|
105
105
|
just run `soywiki`.
|
106
106
|
|
107
107
|
|
108
|
+
You can start SoyWiki from within a running Vim session. To set this up,
|
109
|
+
first install or update SoyWiki, and then run
|
110
|
+
|
111
|
+
soywiki --install-plugin
|
112
|
+
|
113
|
+
Please note that you will need to run this command after each time you update
|
114
|
+
SoyWiki to a newer version.
|
115
|
+
|
116
|
+
Assuming the plugin is installed, you can start SoyWiki from within a
|
117
|
+
running Vim session by typing the command
|
118
|
+
|
119
|
+
:Soywiki
|
120
|
+
|
121
|
+
Make sure when you do this that Vim's working directory is the root of
|
122
|
+
your wiki directory. You can change the working directory for the
|
123
|
+
current Vim window with `:lcd`. See `:help lcd` for more info.
|
124
|
+
|
125
|
+
|
108
126
|
## Basic usage
|
109
127
|
|
110
128
|
For basic use, SoyWiki works exactly like a typical wiki.
|
@@ -119,8 +137,8 @@ link them together. You'll be surprised at how powerful this simple mechanism
|
|
119
137
|
is for organizing your notes.
|
120
138
|
|
121
139
|
In SoyWiki, a wiki page is a simple text file that has a WikiWord title
|
122
|
-
on the first line
|
123
|
-
alter the title line at the top, but it helps you see what wiki page
|
140
|
+
on the first line. Beyond that, you can append any text you want. (You
|
141
|
+
may alter the title line at the top, but it helps you see what wiki page
|
124
142
|
you're on.) SoyWiki will create stub WikiPages for you automatically as
|
125
143
|
you traverse WikiLinks that don't yet reference any content.
|
126
144
|
|
@@ -195,6 +213,7 @@ this. You can press `CTRL-^` to toggle between the current page and the
|
|
195
213
|
last page you looked at.
|
196
214
|
|
197
215
|
* `,m` opens the page list
|
216
|
+
* `,n` opens the namespace list
|
198
217
|
* `,M` opens the inbound links page list
|
199
218
|
|
200
219
|
You can view all the pages in your wiki, most recently modified first,
|
@@ -207,6 +226,9 @@ When you're on a wiki page and you want to see all the other wiki pages
|
|
207
226
|
that link in to it, press `,M`. If there is only one page that links in,
|
208
227
|
you'll be taken there automatically.
|
209
228
|
|
229
|
+
`,n` lets you select from your namespaces. Choosing one will take you to
|
230
|
+
the `HomePage` of that namespace.
|
231
|
+
|
210
232
|
* `,o` opens the first web hyperlink under or after the cursor in the default external web browser
|
211
233
|
* `ENTER` opens the web hyperlink under the cursor in the default external web browser
|
212
234
|
* `,O` opens the web hyperlink under the cursor in a vertical split window
|
data/bin/soywiki-ls-t
CHANGED
data/lib/soywiki.rb
CHANGED
data/lib/soywiki.vim
CHANGED
@@ -106,6 +106,12 @@ func! s:list_pages()
|
|
106
106
|
end
|
107
107
|
endfunc
|
108
108
|
|
109
|
+
func! s:list_namespaces()
|
110
|
+
let s:search_for_link = ""
|
111
|
+
let pages = s:get_namespace_list()
|
112
|
+
call s:page_list_window(pages, 'select-page', "Select namespace: ")
|
113
|
+
endfunc
|
114
|
+
|
109
115
|
func! s:trim_link(link)
|
110
116
|
let link = matchstr(a:link, s:wiki_link_pattern)
|
111
117
|
return link
|
@@ -303,7 +309,7 @@ func! s:omit_this_page(page_list)
|
|
303
309
|
endif
|
304
310
|
endfunc
|
305
311
|
|
306
|
-
"
|
312
|
+
"
|
307
313
|
func! s:get_page_list()
|
308
314
|
" no file current in buffer
|
309
315
|
if len(bufname('')) == 0
|
@@ -318,6 +324,11 @@ func! s:get_page_list()
|
|
318
324
|
return pages
|
319
325
|
endfunction
|
320
326
|
|
327
|
+
func! s:get_namespace_list()
|
328
|
+
let pages = split(system(s:ls_command . " -n"), "\n")
|
329
|
+
return pages
|
330
|
+
endfunction
|
331
|
+
|
321
332
|
|
322
333
|
func! s:pages_in_this_namespace(pages)
|
323
334
|
let namespace = s:page_namespace()
|
@@ -385,7 +396,7 @@ function! CompletePageTitle(findstart, base)
|
|
385
396
|
else
|
386
397
|
let base = s:trimString(a:base)
|
387
398
|
if (base == '')
|
388
|
-
return s:
|
399
|
+
return s:matching_pages
|
389
400
|
else
|
390
401
|
let res = []
|
391
402
|
if bufname('') == 'select-page'
|
@@ -397,7 +408,7 @@ function! CompletePageTitle(findstart, base)
|
|
397
408
|
endfor
|
398
409
|
else
|
399
410
|
" autocomplete inline
|
400
|
-
let pages = base =~ '\C^[a-z]' ? s:
|
411
|
+
let pages = base =~ '\C^[a-z]' ? s:matching_pages : s:pages_in_this_namespace(s:matching_pages)
|
401
412
|
for m in pages
|
402
413
|
if m =~ '^\c' . base
|
403
414
|
call add(res, m)
|
@@ -416,9 +427,13 @@ function! s:select_page()
|
|
416
427
|
if (page == '') " no selection
|
417
428
|
return
|
418
429
|
end
|
419
|
-
|
430
|
+
" if time is just a namespace, append .HomePage to it
|
431
|
+
if page =~ '^[a-z][[:alnum:]_]\+$'
|
432
|
+
let page = page . ".HomePage"
|
433
|
+
endif
|
434
|
+
|
420
435
|
for item in s:matching_pages
|
421
|
-
if (
|
436
|
+
if (page =~ item)
|
422
437
|
call s:load_page(page, 0)
|
423
438
|
break
|
424
439
|
end
|
@@ -581,6 +596,8 @@ endfunc
|
|
581
596
|
func! s:global_mappings()
|
582
597
|
nnoremap <leader>m :call <SID>list_pages()<CR>
|
583
598
|
nnoremap <leader>M :call <SID>list_pages_linking_in()<CR>
|
599
|
+
nnoremap <leader>n :call <SID>list_namespaces()<CR>
|
600
|
+
|
584
601
|
nnoremap <silent> <leader>o :call <SID>find_next_href_and_open()<cr>
|
585
602
|
nnoremap <silent> q :close<cr>
|
586
603
|
" for netrw vertical split
|