Version 0.6

* NEW: Header and footer templates. See g:vimwiki_html_header and g:vimwiki_html_footer in help.
 * FIX: :Vimwiki2HTML does not recognize ~ as part of a valid path.
This commit is contained in:
Maxim Kim 2009-02-04 00:00:00 +00:00 committed by Able Scraper
parent 1833ec1ad9
commit 344daede11

View File

@ -2,15 +2,14 @@
UseVimball UseVimball
finish finish
autoload/vimwiki.vim [[[1 autoload/vimwiki.vim [[[1
932 959
" VimWiki plugin file " VimWiki plugin file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 19.01.2009 23:43 " Last Change: 04.02.2009 12:30
" Version: 0.5.3 " Version: 0.6
if exists("g:loaded_vimwiki_auto") || &cp if exists("g:loaded_vimwiki_auto") || &cp
finish finish
endif endif
@ -401,7 +400,7 @@ function! vimwiki#WikiAll2HTML(path) "{{{
call vimwiki#Wiki2HTML(a:path, wikifile) call vimwiki#Wiki2HTML(a:path, wikifile)
endfor endfor
call s:WikiCreateDefaultCSS(g:vimwiki_home_html) call s:WikiCreateDefaultCSS(g:vimwiki_home_html)
echomsg 'Wikifiles converted.' echomsg 'Done!'
let &more = setting_more let &more = setting_more
endfunction "}}} endfunction "}}}
@ -433,6 +432,20 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
function! s:HTMLHeader(title, charset) "{{{ function! s:HTMLHeader(title, charset) "{{{
let lines=[] let lines=[]
" globals are bad, but...
if g:vimwiki_html_header != ""
try
let lines = readfile(g:vimwiki_html_header)
call map(lines, 'substitute(v:val, "%title%", "'. a:title .'", "g")')
return lines
catch /E484/
call s:msg("Header template ". g:vimwiki_html_header. " does not exist!")
endtry
endif
" if no g:vimwiki_html_header set up or error while reading template
" file -- use default header.
call add(lines, "") call add(lines, "")
call add(lines, '<html>') call add(lines, '<html>')
call add(lines, '<head>') call add(lines, '<head>')
@ -441,14 +454,29 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
call add(lines, '<meta http-equiv="Content-Type" content="text/html; charset='.a:charset.'" />') call add(lines, '<meta http-equiv="Content-Type" content="text/html; charset='.a:charset.'" />')
call add(lines, '</head>') call add(lines, '</head>')
call add(lines, '<body>') call add(lines, '<body>')
return lines return lines
endfunction "}}} endfunction "}}}
function! s:HTMLFooter() "{{{ function! s:HTMLFooter() "{{{
let lines=[] let lines=[]
" globals are bad, but...
if g:vimwiki_html_footer != ""
try
let lines = readfile(g:vimwiki_html_footer)
return lines
catch /E484/
call s:msg("Footer template ". g:vimwiki_html_footer. " does not exist!")
endtry
endif
" if no g:vimwiki_html_footer set up or error while reading template
" file -- use default footer.
call add(lines, "") call add(lines, "")
call add(lines, '</body>') call add(lines, '</body>')
call add(lines, '</html>') call add(lines, '</html>')
return lines return lines
endfunction "}}} endfunction "}}}
@ -483,7 +511,6 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
endwhile endwhile
endfunction! "}}} endfunction! "}}}
" TODO: сделать так, чтобы {{{WikiWord}}} нормально отрабатывал
function! s:processCode(line, code) "{{{ function! s:processCode(line, code) "{{{
let lines = [] let lines = []
let code = a:code let code = a:code
@ -936,7 +963,7 @@ endfunction "}}}
" 2}}} " 2}}}
doc/vimwiki.txt [[[1 doc/vimwiki.txt [[[1
607 645
*vimwiki.txt* A Personal Wiki for Vim *vimwiki.txt* A Personal Wiki for Vim
__ __ ______ __ __ ______ __ __ ______ ~ __ __ ______ __ __ ______ __ __ ______ ~
@ -950,7 +977,7 @@ doc/vimwiki.txt [[[1
Let the help begins ...~ Let the help begins ...~
Version: 0.5.3 ~ Version: 0.6 ~
============================================================================== ==============================================================================
CONTENTS *vimwiki-contents* CONTENTS *vimwiki-contents*
@ -1305,6 +1332,38 @@ Values: path
Set up directory for wiki files converted to HTML: > Set up directory for wiki files converted to HTML: >
let g:vimwiki_home_html = '~/my wiki/html/' let g:vimwiki_home_html = '~/my wiki/html/'
------------------------------------------------------------------------------
Default: "" *g:vimwiki_html_header*
Values: path to a header template
Set up file name for html header template: >
let g:vimwiki_html_header = '~/my wiki/html/header.html'
This header.html could look like: >
<html>
<head>
<link rel="Stylesheet" type="text/css" href="style.css" />
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="contents">
where %title% is replaced by a wiki page name.
------------------------------------------------------------------------------
Default: "" *g:vimwiki_html_footer*
Values: path to a footer template
Set up file name for html header template: >
let g:vimwiki_html_footer = '~/my wiki/html/footer.html'
This footer.html could look like: >
</div>
</body>
</html>
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Default: "index" *g:vimwiki_index* Default: "index" *g:vimwiki_index*
Values: filename without extension Values: filename without extension
@ -1438,6 +1497,11 @@ Vim plugins website: http://www.Vim.org/scripts/script.php?script_id=2226
============================================================================== ==============================================================================
9. Changelog *vimwiki-changelog* 9. Changelog *vimwiki-changelog*
0.6
* [new] Header and footer templates. See|g:vimwiki_html_header| and
|g:vimwiki_html_footer|.
* [fix] |:Vimwiki2HTML| does not recognize ~ as part of a valid path.
0.5.3 0.5.3
* [fix] Fixed |:VimwikiRenameWord|. Error when g:vimwiki_home had * [fix] Fixed |:VimwikiRenameWord|. Error when g:vimwiki_home had
whitespaces in path. whitespaces in path.
@ -1449,10 +1513,10 @@ Vim plugins website: http://www.Vim.org/scripts/script.php?script_id=2226
* [new] Added <Leader>wt mapping to open vimwiki index file in a new tab. * [new] Added <Leader>wt mapping to open vimwiki index file in a new tab.
* [new] Added g:vimwiki_gohome option that controls how|:VimwikiGoHome| * [new] Added g:vimwiki_gohome option that controls how|:VimwikiGoHome|
works when current buffer is changed. (Thanks Timur Zaripov) works when current buffer is changed. (Thanks Timur Zaripov)
* [fix] Fixed |:VimwikiRenameWord|. Very bad behaviour when autochdir isn't * [fix] Fixed |:VimwikiRenameWord|. Very bad behaviour when autochdir
set up. isn't set up.
* [fix] Fixed commands :Wiki2HTML and :WikiAll2HTML to be available only for * [fix] Fixed commands :Wiki2HTML and :WikiAll2HTML to be available only
vimwiki buffers. for vimwiki buffers.
* [fix] Renamed :Wiki2HTML and :WikiAll2HTML to |:Vimwiki2HTML| and * [fix] Renamed :Wiki2HTML and :WikiAll2HTML to |:Vimwiki2HTML| and
|:VimwikiAll2HTML| commands. |:VimwikiAll2HTML| commands.
* [fix] Help file corrections. * [fix] Help file corrections.
@ -1462,8 +1526,8 @@ Vim plugins website: http://www.Vim.org/scripts/script.php?script_id=2226
* [new] Now you can fold headers. * [new] Now you can fold headers.
* [new] <Plug>VimwikiGoHome and <Plug>VimwikiExploreHome were added. * [new] <Plug>VimwikiGoHome and <Plug>VimwikiExploreHome were added.
* [fix] Bug with {{{HelloWikiWord}}} export to HTML is fixed. * [fix] Bug with {{{HelloWikiWord}}} export to HTML is fixed.
* [del] Sync option removed from: Syntax highlighting for preformatted text * [del] Sync option removed from: Syntax highlighting for preformatted
{{{ }}}. text {{{ }}}.
0.5 0.5
* [new] vimwiki default markup to HTML conversion improved. * [new] vimwiki default markup to HTML conversion improved.
@ -1501,15 +1565,16 @@ Vim plugins website: http://www.Vim.org/scripts/script.php?script_id=2226
* [new] Highlight non-existent WikiWords. * [new] Highlight non-existent WikiWords.
* [new] Delete current WikiWord (<Leader>wd). * [new] Delete current WikiWord (<Leader>wd).
* [new] g:vimwiki_smartCR=2 => use Vim comments (see :h comments :h * [new] g:vimwiki_smartCR=2 => use Vim comments (see :h comments :h
formatoptions) feature to deal with list items. (thx -- Dmitry Alexandrov) formatoptions) feature to deal with list items. (thx -- Dmitry
Alexandrov)
* [new] Highlight TODO:, DONE:, FIXED:, FIXME:. * [new] Highlight TODO:, DONE:, FIXED:, FIXME:.
* [new] Rename current WikiWord -- be careful on Windows you cannot rename * [new] Rename current WikiWord -- be careful on Windows you cannot rename
wikiword to WikiWord. After renaming update all links to that renamed wikiword to WikiWord. After renaming update all links to that renamed
WikiWord. WikiWord.
* [fix] Bug -- do not duplicate WikiWords in wiki history. * [fix] Bug -- do not duplicate WikiWords in wiki history.
* [fix] after renaming [[wiki word]] twice buffers are not deleted. * [fix] After renaming [[wiki word]] twice buffers are not deleted.
* [fix] when renaming from [[wiki word]] to WikiWord result is [[WikiWord]] * [fix] Renaming from [[wiki word]] to WikiWord result is [[WikiWord]]
* [fix] more than one complex words on one line is bugging each other when * [fix] More than one complex words on one line is bugging each other when
try go to one of them. [[bla bla bla]] [[dodo dodo dodo]] becomes try go to one of them. [[bla bla bla]] [[dodo dodo dodo]] becomes
bla bla bla]] [[dodo dodo dodo. bla bla bla]] [[dodo dodo dodo.
@ -1525,10 +1590,10 @@ Vim plugins website: http://www.Vim.org/scripts/script.php?script_id=2226
* [new] Added part of Google's Wiki syntax. * [new] Added part of Google's Wiki syntax.
* [new] Added auto insert # with ENTER. * [new] Added auto insert # with ENTER.
* [new] On/Off auto insert bullet with ENTER. * [new] On/Off auto insert bullet with ENTER.
* [new] Strip [[complex wiki name]] from symbols that cannot be used in file * [new] Strip [[complex wiki name]] from symbols that cannot be used in
names. file names.
* [new] Links to non-wiki files. Non wiki files are files with extensions ie * [new] Links to non-wiki files. Non wiki files are files with extensions
[[hello world.txt]] or [[my homesite.html]] ie [[hello world.txt]] or [[my homesite.html]]
0.1 0.1
* First public version. * First public version.
@ -1545,15 +1610,14 @@ it's free enough to suit your needs.
vim:tw=78:ts=8:ft=help:fdm=marker: vim:tw=78:ts=8:ft=help:fdm=marker:
ftplugin/vimwiki.vim [[[1 ftplugin/vimwiki.vim [[[1
98 97
" Vim filetype plugin file " Vim filetype plugin file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:21 " Last Change: 29.01.2009 22:43
" Version: 0.5.3 " Version: 0.6
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
endif endif
@ -1588,8 +1652,8 @@ setlocal fdm=syntax
setlocal commentstring=<!--%s--> setlocal commentstring=<!--%s-->
"" commands {{{2 "" commands {{{2
command! -buffer Vimwiki2HTML call vimwiki#Wiki2HTML(g:vimwiki_home_html, expand('%')) command! -buffer Vimwiki2HTML call vimwiki#Wiki2HTML(expand(g:vimwiki_home_html), expand('%'))
command! -buffer VimwikiAll2HTML call vimwiki#WikiAll2HTML(g:vimwiki_home_html) command! -buffer VimwikiAll2HTML call vimwiki#WikiAll2HTML(expand(g:vimwiki_home_html))
command! -buffer VimwikiNextWord call vimwiki#WikiNextWord() command! -buffer VimwikiNextWord call vimwiki#WikiNextWord()
command! -buffer VimwikiPrevWord call vimwiki#WikiPrevWord() command! -buffer VimwikiPrevWord call vimwiki#WikiPrevWord()
@ -1645,15 +1709,14 @@ if g:vimwiki_smartCR==1
endif endif
" keybindings }}} " keybindings }}}
plugin/vimwiki.vim [[[1 plugin/vimwiki.vim [[[1
75 79
" VimWiki plugin file " VimWiki plugin file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:22 " Last Change: 04.02.2009 12:26
" Version: 0.5.3 " Version: 0.6
if exists("loaded_vimwiki") || &cp if exists("loaded_vimwiki") || &cp
finish finish
@ -1679,13 +1742,18 @@ call s:default('other','0-9_')
call s:default('maxhi','1') call s:default('maxhi','1')
call s:default('stripsym','_') call s:default('stripsym','_')
call s:default('smartCR',1) call s:default('smartCR',1)
call s:default('home_html',g:vimwiki_home."html/")
call s:default('syntax','default') call s:default('syntax','default')
call s:default('gohome','split') call s:default('gohome','split')
call s:default('home_html',g:vimwiki_home."html/")
call s:default('html_header',"")
call s:default('html_footer',"")
call s:default('history',[]) call s:default('history',[])
let g:vimwiki_home = expand(g:vimwiki_home) let g:vimwiki_home = expand(g:vimwiki_home)
let g:vimwiki_home_html = expand(g:vimwiki_home_html)
let g:vimwiki_html_header = expand(g:vimwiki_html_header)
let g:vimwiki_html_footer = expand(g:vimwiki_html_footer)
let upp = g:vimwiki_upper let upp = g:vimwiki_upper
let low = g:vimwiki_lower let low = g:vimwiki_lower
@ -1722,15 +1790,14 @@ endif
noremap <unique><script> <Plug>VimwikiExploreHome :VimwikiExploreHome<CR> noremap <unique><script> <Plug>VimwikiExploreHome :VimwikiExploreHome<CR>
syntax/vimwiki.vim [[[1 syntax/vimwiki.vim [[[1
122 121
" Vim syntax file " Vim syntax file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:22 " Last Change: 29.01.2009 10:27
" Version: 0.5.3 " Version: 0.6
" Quit if syntax file is already loaded " Quit if syntax file is already loaded
if version < 600 if version < 600
syntax clear syntax clear
@ -1834,7 +1901,7 @@ hi def link wikiNoExistsWord Error
hi def link wikiPre PreProc hi def link wikiPre PreProc
hi def link wikiLink Underlined hi def link wikiLink Underlined
hi def link wikiList Type hi def link wikiList Operator
hi def link wikiTable PreProc hi def link wikiTable PreProc
hi def link wikiEmoticons Constant hi def link wikiEmoticons Constant
hi def link wikiDelText Comment hi def link wikiDelText Comment
@ -1846,15 +1913,14 @@ hi def link wikiTodo Todo
let b:current_syntax="vimwiki" let b:current_syntax="vimwiki"
syntax/vimwiki_default.vim [[[1 syntax/vimwiki_default.vim [[[1
66 65
" Vim syntax file " Vim syntax file
" Language: Wiki (vimwiki default) " Language: Wiki (vimwiki default)
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:22 " Last Change: 20.01.2009 19:47
" Version: 0.5.3 " Version: 0.6
" text: *strong* " text: *strong*
" let g:vimwiki_rxBold = '\*[^*]\+\*' " let g:vimwiki_rxBold = '\*[^*]\+\*'
let g:vimwiki_rxBold = '\(^\|\s\+\|[[:punct:]]\)\zs\*[^*`]\+\*\ze\([[:punct:]]\|\s\+\|$\)' let g:vimwiki_rxBold = '\(^\|\s\+\|[[:punct:]]\)\zs\*[^*`]\+\*\ze\([[:punct:]]\|\s\+\|$\)'
@ -1914,15 +1980,14 @@ let g:vimwiki_rxFoldHeadingEnd = '\n\+\ze!'
" vim:tw=0: " vim:tw=0:
syntax/vimwiki_google.vim [[[1 syntax/vimwiki_google.vim [[[1
65 64
" Vim syntax file " Vim syntax file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:22 " Last Change: 20.01.2009 19:47
" Version: 0.5.3 " Version: 0.6
" text: *strong* " text: *strong*
" let g:vimwiki_rxBold = '\*[^*]\+\*' " let g:vimwiki_rxBold = '\*[^*]\+\*'
let g:vimwiki_rxBold = '\(^\|\s\+\|[[:punct:]]\)\zs\*[^*`]\+\*\ze\([[:punct:]]\|\s\+\|$\)' let g:vimwiki_rxBold = '\(^\|\s\+\|[[:punct:]]\)\zs\*[^*`]\+\*\ze\([[:punct:]]\|\s\+\|$\)'
@ -1981,15 +2046,14 @@ let g:vimwiki_rxFoldHeadingEnd = '\n\ze=\+[^=]\+='
" vim:tw=0: " vim:tw=0:
syntax/vimwiki_media.vim [[[1 syntax/vimwiki_media.vim [[[1
60 59
" Vim syntax file " Vim syntax file
" Language: Wiki (MediaWiki) " Language: Wiki (MediaWiki)
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: 20.01.2009 11:22 " Last Change: 20.01.2009 19:47
" Version: 0.5.3 " Version: 0.6
" text: '''strong''' " text: '''strong'''
let g:vimwiki_rxBold = "'''[^']\\+'''" let g:vimwiki_rxBold = "'''[^']\\+'''"