Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I assume those who are reading this page know what vimwiki and dropbox.com 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 dropbox.com/* url: for example a index.html can be accessed by url https://dl-web.dropbox.com/get/Wiki/html/index.html?w=bfead71a, 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 https://dl-web.dropbox.com/get/Wiki/html/index.html?w=SPECIFIED_STRING. 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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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