6

The vimwiki plugin offers a great feature of converting whole Wiki to HTML: :VimwikiAll2HTML. But it bothers me that there are no back links to the main page, and the only way to navigate back to the main page is using the browser's "back" button.

Is there a way to modify the template vimwiki uses to produce HTML? Preferably without touching the plugin internals (I use pathogen and I want it to be portable between Vim installations).

2
  • You should accept your own answer. It seems to completely resolve the question.
    – xthrd
    Feb 5, 2015 at 19:16
  • @xthrd You can only accept your own solution when 48 hours have passed. Feb 6, 2015 at 0:38

1 Answer 1

6

Found a solution in vimwiki documentation. Here's a modification to my .vimrc:

let g:vimwiki_list = [{
  \ 'path': '$HOME/Dropbox/vimwiki',
  \ 'template_path': '$HOME/Dropbox/vimwiki/templates',
  \ 'template_default': 'default',
  \ 'template_ext': '.html'}]

I had to create $HOME/Dropbox/vimwiki/templates/default.html, and I took original HTML file content from vimwiki/autoload/vimwiki/default.tpl.

Obviously $HOME/Dropbox/vimwiki is to be replace with whatever directory your wiki is in.

EDIT: Wrote an article with more detail: http://www.rosipov.com/blog/custom-templates-in-vimwiki/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.