vimwiki / vimwiki

Personal Wiki for Vim
http://vimwiki.github.io/
Other
8.73k stars 628 forks source link

Generated links include all markdown but some have the wrong file extension #1210

Open tompropst opened 2 years ago

tompropst commented 2 years ago

With markdown as the syntax, all markdown files are included in generated links but any files with an extension that differs from the wiki extension will have broken links.

In addition to, or perhaps as a replacement for the vimwiki_markdown_link_ext option, it might be useful to have an option to include the file extension in links regardless of syntax, and preserve the original extension during link generation.

brennen commented 2 years ago

As with #1208, I'm pretty sure the answer here is that VimWiki doesn't support mixing file extensions within a single wiki, and I think that adding that behavior would be more complexity than it's worth. That said, I want to spend some time making sure my read on this is correct before closing this issue.

Edit: I'll add that I'd be happy to help figure out a rename on existing files, if that'd be useful. My goto would probably be rename and some sed incantation, but there might be better options if on Win/Mac...

tompropst commented 2 years ago

Thanks for the offer, @brennen. I can tackle cleaning up my project to use a single extension. I don't necessarily think VimWiki should support mixing file extensions but it seems like it has "partial support" now. I debated opening this issue but thought it was worthwhile since the issue happens even if you are not intentionally trying to mix extensions.

For example, say a user copies a markdown file into their wiki but it has a different extension. In this situation, they should rename it but may not think to do that. If they then generate links, they will get a link for the file (the "partial support") however the link will not work. Unless they check / test each link, it may go unnoticed. If they are exporting to HTML the error will propagate.

brennen commented 2 years ago

I don't necessarily think VimWiki should support mixing file extensions but it seems like it has "partial support" now. I debated opening this issue but thought it was worthwhile since the issue happens even if you are not intentionally trying to mix extensions.

Yeah, I think it would be good for the documentation to be clearer about this, at minimum, and some software archeology is warranted to figure out intent of the existing features. It does sound like something's off with the link generation.

(Thanks for being understanding, and apologies if I came across a bit short in my replies to these issues. I know how frustrating it can be to get a "closed wontfix" on an issue you've encountered and put the time into articulating clearly.)

tompropst commented 2 years ago

Your responses here have been very thoughtful and appropriate. I appreciate the quick feedback.

I don't have any experience with Vim plugin development so I haven't yet figured out how this is working. I will definitely submit a documentation PR if I come up with anything that helps.