forked from vim-scripts/vimwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Concealing of links can be turned off - set |g:vimwiki_url_maxsave| to 0. The option g:vimwiki_url_mingain was removed * |g:vimwiki_folding| also accepts value 'list'; with 'expr' both sections and code blocks folded, g:vimwiki_fold_lists option was removed * Issue 261: Syntax folding is back. |g:vimwiki_folding| values are changed to '', 'expr', 'syntax'. * Issue 372: Ignore case in g:vimwiki_valid_html_tags * Issue 374: Make autowriteall local to vimwiki. It is not 100% local though. * Issue 384: Custom_wiki2html script now receives templating arguments * Issue 393: Custom_wiki2html script path can contain tilde character * Issue 392: Custom_wiki2html arguments are quoted, e.g names with spaces * Various small bug fixes.
- Loading branch information
1 parent
d19cc85
commit cb5c38a
Showing
7 changed files
with
330 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,15 @@ | |
" Author: Maxim Kim <[email protected]> | ||
" Home: http://code.google.com/p/vimwiki/ | ||
|
||
" XXX: This file should be refactored! | ||
" TODO: We need vimwiki abstract syntax tree. If properly designed it wourld | ||
" greatly symplify different syntax to HTML generation. | ||
" | ||
" vimwiki -- --> PDF | ||
" \ / | ||
" markdown -----> AST -----> HTML | ||
" / \ | ||
" mediawiki -- --> Latex | ||
" | ||
|
||
" Load only once {{{ | ||
if exists("g:loaded_vimwiki_html_auto") || &cp | ||
|
@@ -137,22 +145,12 @@ endfunction "}}} | |
|
||
function! s:safe_html(line) "{{{ | ||
" escape & < > when producing HTML text | ||
" uses variables s:lt_pattern, s:gt_pattern that are | ||
" set in vimwiki#html#Wiki2HTML() according to g:vimwiki_valid_html_tags | ||
"" htmlize symbols: < > & | ||
|
||
" s:lt_pattern, s:gt_pattern depend on g:vimwiki_valid_html_tags | ||
" and are set in vimwiki#html#Wiki2HTML() | ||
let line = substitute(a:line, '&', '\&', 'g') | ||
" the following depends on g:vimwiki_valid_html_tags | ||
let line = substitute(line,s:lt_pattern,'\<', 'g') | ||
let line = substitute(line,s:gt_pattern,'\>', 'g') | ||
|
||
"let tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') | ||
"let line = substitute(line,'<\%(/\?\%(' | ||
" \.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?>\)\@!', | ||
" \'\<', 'g') | ||
"let line = substitute(line,'\%(</\?\%(' | ||
" \.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?\)\@<!>', | ||
" \'\>', 'g') | ||
return line | ||
endfunction "}}} | ||
|
||
|
@@ -456,11 +454,10 @@ function! s:tag_wikilink(value) "{{{ | |
if g:vimwiki_debug > 1 | ||
echom '[[idx='.idx.', scheme='.scheme.', path='.path.', subdir='.subdir.', lnk='.lnk.', ext='.ext.']]' | ||
endif | ||
let url = escape(url, '#') | ||
let line = vimwiki#html#linkify_link(url, descr) | ||
return line | ||
endfunction "}}} | ||
"}}} v1.3 links | ||
"}}} | ||
|
||
|
||
function! s:tag_remove_internal_link(value) "{{{ | ||
|
@@ -1352,13 +1349,17 @@ endfunction " }}} | |
|
||
function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) "{{{ | ||
call vimwiki#base#mkdir(a:path) | ||
execute '!'.VimwikiGet('custom_wiki2html'). ' ' | ||
echomsg system(VimwikiGet('custom_wiki2html'). ' '. | ||
\ a:force. ' '. | ||
\ VimwikiGet('syntax'). ' '. | ||
\ strpart(VimwikiGet('ext'), 1). ' '. | ||
\ a:path. ' '. | ||
\ a:wikifile. ' '. | ||
\ s:default_CSS_full_name(a:path) | ||
\ shellescape(a:path, 1). ' '. | ||
\ shellescape(a:wikifile, 1). ' '. | ||
\ shellescape(s:default_CSS_full_name(a:path), 1). ' '. | ||
\ (len(VimwikiGet('template_path')) > 1 ? shellescape(expand(VimwikiGet('template_path')), 1) : '-'). ' '. | ||
\ (len(VimwikiGet('template_default')) > 0 ? VimwikiGet('template_default') : '-'). ' '. | ||
\ (len(VimwikiGet('template_ext')) > 0 ? VimwikiGet('template_ext') : '-'). ' '. | ||
\ (len(VimwikiGet('subdir')) > 0 ? shellescape(s:root_path(VimwikiGet('subdir')), 1) : '-')) | ||
endfunction " }}} | ||
|
||
function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ | ||
|
@@ -1415,8 +1416,8 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ | |
let s:gt_pattern = '>' | ||
if g:vimwiki_valid_html_tags != '' | ||
let tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') | ||
let s:lt_pattern = '<\%(/\?\%('.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?>\)\@!' | ||
let s:gt_pattern = '\%(</\?\%('.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?\)\@<!>' | ||
let s:lt_pattern = '\c<\%(/\?\%('.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?>\)\@!' | ||
let s:gt_pattern = '\c\%(</\?\%('.tags.'\)\%(\s\{-1}\S\{-}\)\{-}/\?\)\@<!>' | ||
endif | ||
|
||
for line in lsource | ||
|
@@ -1566,7 +1567,7 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ | |
endfunction "}}} | ||
|
||
function! s:file_exists(fname) "{{{ | ||
return !empty(getftype(a:fname)) | ||
return !empty(getftype(expand(a:fname))) | ||
endfunction "}}} | ||
|
||
" uses VimwikiGet('path') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.