iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.61k stars 275 forks source link

open linked files #58

Open rjshrjndrn opened 5 years ago

rjshrjndrn commented 5 years ago

Hi, 1st of all thank you for this awesome plugin. I have a small question. Is it possible to open a linked file from one markdown? eg

this is [doc](doc.md)

and :MarkDownPreview but I am not able to click and open the file.

Regards, Rajesh

llinfeng commented 5 years ago

还有还有,能不能一口气把一个directory下面的所有Markdown file一并_preview_一下?这个在捣鼓documentation的时候尤其有帮助

rjshrjndrn commented 5 years ago

Can you please translate in English.

llinfeng commented 5 years ago

@rjshrjndrn I was simply extending on your original request. I also found that the links pointing to other *.md documents are broken in the Previews. Additionally, I was wondering if there is an option to preview an entire directory, wherein all the *.md files are made available in the Preview window/server.

Currently, from a valid Preview page with URL http://127.0.0.1:9054/page/2, if I were to click on a link [Eagle](Eagle.md), I will get forwarded to a new URL http://127.0.0.1:9054/page/Eagle ==> should all *.md files be available for the previews, I bet there is a high chance that these linked files can be rendered properly.

be99inner commented 4 years ago

It's also have a problem when you link to a another markdown file under folder.

this link [another](docs/another.md)

Preview will return 404 when you click on that link.

eorus commented 4 years ago

This will also help vimwiki index.md previews i guess. Looking forwarrd for it.

llinfeng commented 4 years ago

@eorus @be99inner One possible solution is to use other tools to host Markdown files for preview. I use markserv to host all files in my Vimwiki directory, and use :MarkdownPreview for one-off situations.

eorus commented 4 years ago

Thanks @llinfeng for introducing markserv. Had a chance to look and decided to run it on I3 startup and use localhost:8642/index.md.

ncharchut commented 4 years ago

Is there any update on this becoming a feature of MarkdownPreview? It would be really useful, and I would imagine that changing the url from something like ../page/1 to ../[filename] isn't that difficult.

whytong commented 3 years ago

Seems this issue has been raised for a while and I am wondering whether there has been any update.

I have the same issue with link to files but not pictures or urls, i.e.

![dog pic](./dog.jpg) works
[link to website](https://www.google.com) works

[link to file](./file.md) does not work
[link to file2](./_resources/file2.pdf) does not work

These same codes work in other editors such as Atom or Joplin. Could there be a security issue that prevents the opening of linked local files? Can it be disabled?

cstsunfu commented 3 years ago

@iamcco Hi, Is there any update on this?

Thanks for your awesome job.

daephx commented 2 years ago

I was looking for an open issue similar to this, I apologize if I overlooked anything.

But, what about handling wiki links? A lot of my notes started off in Obsidian.md and I've been playing around with VimWiki markdown recently.

Wikilink: 
Research in [[Computer Science]]
Equivalent to: 
Research in [Computer Science](./Computer Science.md)

When creating a link like this in either application a new file of the same name is created so I'm not sure what would be best for handling filenames that include spaces, or if it could be translated in the browser to something like: http://127.0.0.1:9054/page/computer_science http://127.0.0.1:9054/page/computer%20science

domas-v commented 2 years ago

Any updates on this?

Btw, thank you for this amazing plugin ❤️

jannis-baum commented 1 year ago

I implemented something like this in #543. Clicking a linked markdown file will open it in Vim and then refresh the browser to show that file's preview.

Since there are quite a few pull requests that didn't get merged or any feedback, this one will probably be the same. In case you want to use it anyways and need help with the compilation or manual setup, let me know and I'll try to help! :)

Tweekism commented 1 month ago

Hey @jannis-baum

Are you still using this plugin? I'm looking at trying to revive it. If not, what did you move to?

jannis-baum commented 1 month ago

Hey @jannis-baum

Are you still using this plugin? I'm looking at trying to revive it. If not, what did you move to?

Hello! @Tweekism No, I'm no longer using it. I actually made my own Markdown viewer: Vivify. I think it can do everything this one can but it's actively maintained and has some other features such as opening linked files :) I'd be happy for you to check it out! If you have any questions or requests for other features, feel free to open an issue

Tweekism commented 1 month ago

So I found it right after posting this by looking at your closed PR here.

I'll drop around into your discussions over there if thats ok?

jannis-baum commented 1 month ago

Yes of course! :)