vimwiki/test/command_toc.vader
Tinmarino 2332dc1514 Refactor: Test & Doc: Remove test/vader_include and move DesignNotes to doc
- vader_include is declareing functions -> faster to load (parse) once in
vimrc
- DesignNotes is doc so goes to doc
2020-07-29 23:29:03 -04:00

173 lines
3.2 KiB
Plaintext

# VimwikiTOC
Execute (Reset TOC header to default):
let g:vimwiki_global_vars['toc_header'] = "Contents"
Given vimwiki (Headings):
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Execute (Set syntax markdown && Set sw=8):
call SetSyntax('markdown')
set sw=8
Execute (VimwikiTOC):
VimwikiTOC
Expect (With a TOC sw=8):
# Contents
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Execute (Set sw=4 && VimwikiTOC):
set sw=4
VimwikiTOC
Expect (With a TOC sw=4):
# Contents
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Do (Destroy some stuff):
jj
dd
jj
dd
Execute (VimwikiTOC):
VimwikiTOC
Expect (Brand new TOC):
# Contents
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Execute (Let toc_header = Sommaire && VimwikiTOC):
let g:vimwiki_global_vars['toc_header'] = "Sommaire"
VimwikiTOC
Expect (Append a Sommaire && Leave Contents alone):
# Sommaire
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Do (Destroy some stuff):
jj
dd
jj
dd
Execute (VimwikiTOC):
VimwikiTOC
Expect (Brand new TOC with sommaire):
# Sommaire
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
Execute (call vimwiki#vars#set_global('toc_header_level', 6):
call vimwiki#vars#set_global('toc_header_level', 6)
VimwikiTOC
# Reset default
call vimwiki#vars#set_global('toc_header_level', 1)
Expect (Content prepended):
###### Sommaire
- [Header 1](#Header 1)
- [Header 1.1](#Header 1#Header 1.1)
- [Header 1.1.1](#Header 1#Header 1.1#Header 1.1.1)
- [Header 2](#Header 2)
- [Header 2.1.1](#Header 2#Header 2.1.1)
# Header 1
random text
## Header 1.1
random text
### Header 1.1.1
random text
# Header 2
### Header 2.1.1
" vim: sw=2 foldmethod=indent foldlevel=30 foldignore=#