Feature: Add handling of absolute path to vimwiki #811 from @justrajdeep

- update vimwiki link handling so that if using env variables it is resolved
- add [[//absolute_path]] to handle absolute path
- updated doc to reflect the changes
This commit is contained in:
Rajdeep
2020-01-26 20:39:03 -05:00
committed by Tinmarino
parent 8cf2789840
commit e3e841f335
3 changed files with 91 additions and 10 deletions

View File

@ -1,8 +1,68 @@
Include: vader_includes/vader_setup.vader
# Absolute links {{{1
####################
Execute (Log):
Log 'Absolute links'
# For markdown {{{2
# ------------------
Execute (Set filename wiki_test.md):
Log '>> Absolute link, markdown syntax'
file wiki_test.md
call SetSyntax('markdown')
Given vimwiki(some wiki link):
[test1](//$HOME/in_home1)
[test2](//~/in_home2)
[test3](///tmp/in_tmp)
Do (Check in_home1):
\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home1.md'\<Cr>
Do (Check in_home2):
j\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home2.md'\<Cr>
Do (Check in_tmp):
jj\<Cr>
:AssertEqual expand('%'), '/tmp/in_tmp.md'\<Cr>
# For Wiki {{{2
# ------------------
Execute (Set filename wiki_test.wiki):
Log '>> Absolute link, wiki syntax'
file wiki_test.wiki
call SetSyntax('default')
Given vimwiki(some wiki link):
[[//$HOME/in_home1]]
[[//~/in_home2]]
[[///tmp/in_tmp]]
Do (Check in_home1):
\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home1.wiki'\<Cr>
Do (Check in_home2):
j\<Cr>
:AssertEqual expand('%'), $HOME.'/in_home2.wiki'\<Cr>
Do (Check in_tmp):
jj\<Cr>
:AssertEqual expand('%'), '/tmp/in_tmp.wiki'\<Cr>
# Link with dot {{{1
####################
Execute (Log):
Log 'Link with dot'
Given vimwiki (filnames with dots):
part1.part2.part3
part1.part2.part3.md
@ -39,6 +99,9 @@ Do (j<Cr><Cr>):
# Rest {{{1
##########################
Execute (Log):
Log 'And more'
Given vimwiki (Text that is not a wikilink):
test
www.google.com