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

Error: All2HTML can't open default.tpl #1193

Closed
Reikimann opened this issue Dec 5, 2021 · 2 comments
Closed

Error: All2HTML can't open default.tpl #1193

Reikimann opened this issue Dec 5, 2021 · 2 comments

Comments

@Reikimann
Copy link

Reikimann commented Dec 5, 2021

I'm using Neovim and Packer as my package manager.

When trying to convert my files to HTML
I get this message:

Vimwiki: Saving Vimwiki files ...

Vimwiki: Deleting non-wiki html files ...

Vimwiki: Converting wiki to html files ...
Vimwiki: Processing /home/my_user/vimwiki/index.wiki

Error detected while processing function vimwiki#html#WikiAll2HTML [45] ..<SNR>73_convert_file[110] ..<SNR>73_get_html_template: 

line 20:

E484: Can't open file /home/my_user/.local/share/nvim/site/pack/*/start/*/autoload/vimwiki/default.tpl

Press ENTER or type command to continue

The file is there, I have checked.
Pls help

@leyhline
Copy link
Contributor

I just had the same problem. Seems to be a problem with expanding the * in the path. I use no plugin manager and just ran git clone using the default package mechanism.

I also quickly wrote a fix:

diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim
index 0da3d81..ec0bda9 100644
--- a/autoload/vimwiki/html.vim
+++ b/autoload/vimwiki/html.vim
@@ -54,8 +54,9 @@ endfunction
 function! s:find_autoload_file(name) abort
   for path in split(&runtimepath, ',')
     let fname = path.'/autoload/vimwiki/'.a:name
-    if glob(fname) !=? ''
-      return fname
+    let match = glob(fname)
+    if match !=? ''
+      return match
     endif
   endfor
   return ''

I just not sure if this is 100% bulletproof since I don't have a good grasp of Vimscript. Maybe I can prepare a pull request nevertheless.

leyhline added a commit to leyhline/vimwiki that referenced this issue Dec 17, 2021
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.

Resolves vimwiki#1193
leyhline added a commit to leyhline/vimwiki that referenced this issue Dec 17, 2021
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.

Resolves vimwiki#1193
leyhline added a commit to leyhline/vimwiki that referenced this issue Dec 17, 2021
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.

Resolves vimwiki#1193
tinmarino pushed a commit that referenced this issue Dec 18, 2021
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.

Resolves #1193
@tinmarino
Copy link
Member

Fixed by #1195

jls83 pushed a commit to jls83/vimwiki that referenced this issue Jan 17, 2023
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.

Resolves vimwiki#1193
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

3 participants