markdown-preview.nvim
markdown-preview.nvim copied to clipboard
open linked files
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
还有还有,能不能一口气把一个directory下面的所有Markdown file一并_preview_一下?这个在捣鼓documentation的时候尤其有帮助
Can you please translate in English.
@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.
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.
This will also help vimwiki index.md previews i guess. Looking forwarrd for it.
@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.
-
markserv
is fired from the root folder where all my Vimwiki files lives. Thus, it is aware of all the files as linked through Markdown syntax. For example,[Another Page](another_page.md)
shall link to theanother_page.md
properly. Reference to sections is a bit more complicated but doable; - The
MarkdownPreview
command in this repo is better at syncing the cursor location from Vim to the rendered webpage.
Thanks @llinfeng for introducing markserv. Had a chance to look and decided to run it on I3 startup and use localhost:8642/index.md.
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.
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.
 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?
@iamcco Hi, Is there any update on this?
Thanks for your awesome job.
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
Any updates on this?
Btw, thank you for this amazing plugin ❤️
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! :)