Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with neovim ? #9

Closed
copyme opened this issue Jul 11, 2017 · 12 comments
Closed

Does not work with neovim ? #9

copyme opened this issue Jul 11, 2017 · 12 comments

Comments

@copyme
Copy link

copyme commented Jul 11, 2017

So I think I put everything all together:

init.vim

let g:vimwiki_list = [{
  \ 'path': '$HOME/Documents/PersonalWiki',
  \ 'syntax': 'markdown', 'ext': '.md',
  \ 'custom_wiki2html': 'vimwiki_markdown',
  \ 'template_path': '$HOME/Documents/PersonalWiki/templates',
  \ 'template_default': 'default',
  \ 'template_ext': '.tpl'}]

default.tpl

<!DOCTYPE html>
<html>
<head>
<link rel="Stylesheet" type="text/css" href="%root_path%%css%">
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%encoding%">
 %pygments%
</head>
<body>
<script type="text/javascript" src="../PersonalWiki/templates/MathJax-2.7.0/MathJax.js?config=TeX
AMS-MML_HTMLorMML"></script>
%content%
</body>
</html>

The gem is installed without problems but yet I have an error which says that a conversion from markdown to HTML is not supported.

@patrickdavey
Copy link
Owner

Hmmmm, honestly, I have no idea. I don't use neovim (yet, though it does sound promising)

Is your vimwiki up to date? As it does require this commit to be part of your vimwiki plugin.

If you work out the issue (and it is neovim specific) please do submit a PR :)

@has2k1
Copy link
Contributor

has2k1 commented Jul 11, 2017

I use vimwiki with neovim without any issues
.

@patrickdavey
Copy link
Owner

Well, I'm going to close this issue seeing as @has2k1 has it working with Neovim. I'd double check the commit I referenced above, just to make sure your version of vimwiki can use binaries.

This gem itself, in a way, has nothing to do with vimwiki.. it's just a script that can be called passing in a few arguments (where files are, templates etc.) and then parses them. It's not really anything to do with vimwiki (unless vimwiki changed the arguments it was sending through).

@copyme
Copy link
Author

copyme commented Jul 27, 2017

In fact, I found the source of the problem. In the binary file created by gem install is named vimwiki_markdown.ruby2.1 and not vimwiki_markdown.

@patrickdavey
Copy link
Owner

That's bizarre! If you look in the bin folder -> https://github.com/patrickdavey/vimwiki_markdown/tree/master/bin you'll see the binary is called vimwiki_markdown That is something I've not seen before! What operating system are you using @copyme ? Are you using rvm or anything else to manage your ruby version(s) and gems?

@copyme
Copy link
Author

copyme commented Jul 28, 2017

@patrickdavey I use openSUSE Leap 42.3 and I mostly use ruby related packages provided by the operating system repositories, with some exceptions. For the exceptions I just use the gem command. Sorry I am not very familiar with the ruby ecosystem, etc.

@NikosAlexandris
Copy link

The settings in vimwiki.rc sourced within from vimrc:

set nocompatible
filetype plugin on
syntax on
set foldmethod=syntax

set runtimepath+=~/archive/notes/vimwiki
let g:vimwiki_root = $HOME . '/archive/notes/vimwiki'
let g:vimwiki_list = [{
            \ 'path': $HOME . '/archive/notes/vimwiki',
            \ 'path_html': $HOME . '/archive/notes/vimwiki/html',
            \ 'syntax': 'markdown',
            \ 'ext': '.md',
            \ 'template_path': '/archive/notes/vimwiki/templates/',
            \ 'template_default': 'default',
            \ 'template_ext': '.tpl',
            \ 'custom_wiki2html': 'vimwiki_markdown',
            \ 'html_filename_parameterization': 1}]
let g:vimwiki_global_ext = 0

and the default.tpl:

<!DOCTYPE html>
<html lang="en">
  <head>
  <title>%title%</title>
  %date%

  %pygments%
</head>
<body id="%title%">
  <h2 id="title">%title%</h2>
  %content%
</body>
</html>

I run on vimwiki version 2.4 (2019-03-24) and I just installed vimwiki_markdown today.
Any attempt to :Vimwiki2HTML fails with:

Vimwiki Error: Conversion to HTML is not supported for this syntax

How can I "debug" this problem?

@patrickdavey
Copy link
Owner

is vimwiki_markdown available on your PATH? (what happens if you type which vimwiki_markdown ?

As mentioned at the top of the thread, this is unlikely to be a vimwiki_markdown issue, and probably more to do with where it's installed (e.g. the SUSE install changing the name of the binary). Also, #9 (comment) has it working in neovim...

But, chances are that vimwiki_markdown isn't on your PATH.

@NikosAlexandris
Copy link

NikosAlexandris commented May 12, 2019

is vimwiki_markdown available on your PATH? (what happens if you type which vimwiki_markdown ?

As mentioned at the top of the thread, this is unlikely to be a vimwiki_markdown issue, and probably more to do with where it's installed (e.g. the SUSE install changing the name of the binary). Also, #9 (comment) has it working in neovim...

But, chances are that vimwiki_markdown isn't on your PATH.

Probably this is the case.

→ which vimwiki_markdown
bash: type: vimwiki_markdown: not found

Here's where it is:

→ gem which 'vimwiki_markdown'
/home/nik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown.rb

Actually, the binary is under:

/home/nik/.gem/ruby/2.4.0/bin/vimwiki_markdown

I am not sure what is best: add "$HOME/.gem" to PATH or install gem(s) under /usr/local/bin (i.e. via gem: --bindir /usr/local/bin or similar under /usr/bin)?

In fact, the following

GEM_PATH="$HOME/.gem"
export PATH="${GEM_PATH}:$PATH"

won't work as the binary(-ies) are not exactly under ~/.gem. Off-topic, but I wonder if I should add all bin sub-directories under ~/.gem?

@NikosAlexandris
Copy link

NikosAlexandris commented May 13, 2019

I manually soft-linked the binary under /usr/local/bin and here's what I get for a test page, written in Markdown:

WARNING: Nokogiri was built against LibXML version 2.9.9, but has dynamically loaded 2.9.8^@/home/nik/.gem
/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown/template.rb:24:in `initialize': No such file
or directory @ rb_sysopen - /archive/notes/vimwiki/templates/default.tpl (Errno::ENOENT)^@^Ifrom /home/nik
/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown/template.rb:24:in `open'^@^Ifrom /home/n
ik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown/template.rb:24:in `get_template_conten
ts'^@^Ifrom /home/nik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown/template.rb:9:in `i
nitialize'^@^Ifrom /home/nik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown.rb:13:in `ne
w'^@^Ifrom /home/nik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/lib/vimwiki_markdown.rb:13:in `convert_wi
kimarkdown_to_html'^@^Ifrom /home/nik/.gem/ruby/2.4.0/gems/vimwiki_markdown-0.3.3/bin/vimwiki_markdown:4:i
n `<top (required)>'^@^Ifrom /usr/local/bin/vimwiki_markdown:23:in `load'^@^Ifrom /usr/local/bin/vimwiki_m
arkdown:23:in `<main>'^@
Vimwiki: HTML conversion is done, output: /home/nik/archive/notes/vimwiki/html/

The conversion is not done. Maybe the error/warning message is mis-leading?
Looks like a dependency (version) problem.

@NikosAlexandris
Copy link

OK, I had a mis-typed path to the default.tlp file. It works now. Although the warning message still persists.

@patrickdavey
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants