2332dc1514
- vader_include is declareing functions -> faster to load (parse) once in vimrc - DesignNotes is doc so goes to doc
97 lines
2.2 KiB
Plaintext
97 lines
2.2 KiB
Plaintext
# Tag generation
|
|
|
|
Execute (Copy Wiki's Resources):
|
|
Log "Start: Copy Resources"
|
|
call CopyResources()
|
|
|
|
Execute (Setup):
|
|
set sw=4
|
|
AssertEqual 4, &sw
|
|
|
|
Execute (Edit Test-Tag.md):
|
|
edit $HOME/testmarkdown/Test-Tag.md
|
|
AssertEqual $HOME . '/testmarkdown/Test-Tag.md', expand('%')
|
|
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
|
|
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
|
|
|
|
Do (Create File Content):
|
|
:edit $HOME/testmarkdown/Test-Tag.md\<CR>
|
|
I
|
|
:top-tag:\<CR>
|
|
\<CR>
|
|
# A header\<CR>
|
|
\<CR>
|
|
:test-tag:\<CR>
|
|
\<CR>
|
|
# Another header\<CR>
|
|
\<CR>
|
|
Words here.\<CR>
|
|
If tag isn't within 2 lines of header then it has a direct link instead of\<CR>
|
|
a link to the header.\<CR>
|
|
\<CR>
|
|
:second-tag:
|
|
\<Esc>
|
|
:write\<CR>
|
|
:VimwikiRebuildTags\<CR>
|
|
|
|
Execute (Edit tags file):
|
|
edit $HOME/testmarkdown/.vimwiki_tags
|
|
AssertEqual $HOME . '/testmarkdown/.vimwiki_tags', expand('%')
|
|
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
|
|
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
|
|
|
|
# Note: tags file uses tabs
|
|
Expect (Correctly formatted tags file):
|
|
!_TAG_FILE_FORMAT 2
|
|
!_TAG_FILE_SORTED 1
|
|
!_TAG_OUTPUT_MODE vimwiki-tags
|
|
!_TAG_PROGRAM_AUTHOR Vimwiki
|
|
!_TAG_PROGRAM_NAME Vimwiki Tags
|
|
!_TAG_PROGRAM_URL https://github.com/vimwiki/vimwiki
|
|
!_TAG_PROGRAM_VERSION 2.5
|
|
second-tag Test-Tag.md 13;" vimwiki:Test-Tag\tTest-Tag#second-tag
|
|
test-tag Test-Tag.md 5;" vimwiki:Test-Tag\tTest-Tag#A header
|
|
top-tag Test-Tag.md 1;" vimwiki:Test-Tag\tTest-Tag
|
|
|
|
Execute (Generate tags):
|
|
edit $HOME/testmarkdown/Test-Tag.md
|
|
VimwikiGenerateTagLinks
|
|
|
|
Expect (Correctly generated tags section):
|
|
:top-tag:
|
|
|
|
# A header
|
|
|
|
:test-tag:
|
|
|
|
# Another header
|
|
|
|
Words here.
|
|
If tag isn't within 2 lines of header then it has a direct link instead of
|
|
a link to the header.
|
|
|
|
:second-tag:
|
|
|
|
# Generated Tags
|
|
|
|
## second-tag
|
|
|
|
- [second-tag](Test-Tag#second-tag)
|
|
|
|
## test-tag
|
|
|
|
- [A header](Test-Tag#A header)
|
|
|
|
## top-tag
|
|
|
|
- [Test-Tag](Test-Tag)
|
|
|
|
Execute (Clean Test-Tag and .vimwiki_tags):
|
|
Log "End: Clean"
|
|
call system("rm $HOME/testmarkdown/Test.md")
|
|
call system("rm $HOME/testmarkdown/.vimwiki_tags")
|
|
call system("rm $HOME/testmarkdown/Test-Tag.md")
|
|
call DeleteHiddenBuffers()
|
|
|
|
# vim: sw=2:foldlevel=30:foldmethod=indent:
|