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

[Feature] consider file link start with / as absolute path base on repository dir like github #6194

Open
hanjie-chen opened this issue Dec 17, 2024 · 0 comments

Comments

@hanjie-chen
Copy link

hanjie-chen commented Dec 17, 2024

if I want to use absolute path which based on repository, I failed.
for example, here is my directory:

PS C:\Users\Plain\PersonalArticles
...
├───template
│   ├───images
│   │   └───cover_image.jpeg
│   └───Article_Template.md
├───tools-guide
│   ├───git-guide
│   │   ├───images
│   │   │   └───cover_image.png
│   │   └───git-usage.md
...
└───README.md

usually, I use relative path to show image for example in Article_Template.md, for example I will use ./images/cover_image.jpeg.

when I want to link file git-usage.md, I want to use like that /tools-guide/git-guide/git-usage.md which is work on github, you can test it in here: https://github.com/hanjie-chen/PersonalArticles/blob/main/template/Article_Template.md

But when I try it in local, it shows following error message:

Cannot open location /tools-guide/git-guide/git-usage.md, would you want to create file at /tools-guide/git-guide/git-usage.md and continue?

which use absolute path base on C:\ actually

My troubleshoot:

I check the typora document about the links: https://support.typora.io/Links/
it shows expected behavior:

[Readme4](/User/root/Docs/Readme1.md)

when I want to find out a solution, it seems it only works image https://support.typora.io/Images/#display-images-in-relative-path
use typora-root-url in YAML, I test it in my environment, it only works for image.

and it seems there is a typora-plugin named redirectLocalRootUrl have same effect, but also only work for images (I also test it in my personal environment): obgnail/typora_plugin#259

consider

if we need use / as absolute path base on project dir, there must be somewhere to type repository dir

@hanjie-chen hanjie-chen changed the title [Feature] consider file link start with / as absolute path base on project dir like github [Feature] consider file link start with / as absolute path base on repository dir like github Dec 17, 2024
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

1 participant