Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I assume those who are reading this page know what vimwiki and are and what they are for, so I might directly go into my confusion.

The common way of setting a PRIVATE vimwiki on Dropbox is to simply let your vimwiki directories be under the Dropbox folder (but not Dropbox/Public/ because it would be PUBLIC). Dropbox allows directly viewing html with* url: for example a index.html can be accessed by url, being added after the file name a specified string, ?w=bfead71a.

Hence, if inside index.html there is reference to A.html, which is located in the same folder index.html is in, it has to be accessed using some url like But it is seemingly impossible to hack vimwiki in order to make the hrefs in converted htmls corrected in this way.

Is there some approach that can resolve this problem?

share|improve this question

Just search for "href" in '.vim/autoload/vimwiki_html.vim' and add the specified string where appropriate.

E.g. change this:

  let link = '<a href="'.vimwiki#safe_link(a:src).
        \ '.html">'.a:caption.'</a>'

to this:

  let link = '<a href="'.vimwiki#safe_link(a:src).
        \ '.html?w=SPECIFIED_STRING">'.a:caption.'</a>'

Of course, to make it less hacky and enable publishing to different targets, you'd want to make that conditional and configurable ;-)

One approach to making it be configurable would be to introduce a new global variable, e.g. g:vimwiki_internal_link. Make that be a pattern into which the wikiname will be inserted:

let g:vimwiki_internal_link=textbefore__textafter

By default the value would be __.html, and you could change it to __.html?w=SPECIFIED_STRING. Then you would have to add code to '.vim/autoload/vimwiki_html.vim' to do the substitution.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .