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

Ehancement: Can we add support to translate local disk path to local same-directory path? #11

Open
hazzm02 opened this issue Aug 7, 2023 · 3 comments

Comments

@hazzm02
Copy link

hazzm02 commented Aug 7, 2023

For example,

in origin.md, there is a line like this:
![](C:\Users\bob\Downloads\20230404180127.png)

convert it to:
![](./images/20230807_1129162009.png)

After converting, the file is also copied to the new directory.

Sometimes we need such conversion because sphinx-doc can not refer to a path out of the source directory.

Thank you!

@Undertone0809
Copy link
Owner

I'm sorry. Maybe you should provide a more detail example to show your idea. Do you want to convert the image path to an absolute path or else?

@hazzm02
Copy link
Author

hazzm02 commented Aug 7, 2023

Sorry that i did not make it clear.

The original path is a abs path, but it is already on a local disk.
The new path is a relative path, which is often at same directory as the markdown file or the sub directory of the markdown file.

For example:
in file mds/test.md:
![](C:\Users\bob\Downloads\20230404180127.png)

in file converted_mds/test.md:
![](./images/20230807_1129162009.png)

The file C:\Users\bob\Downloads\20230404180127.png is copied to converted_mds/images/20230807_1129162009.png.

@ForeUP
Copy link

ForeUP commented Dec 14, 2023

You can use Joplin as a bridge to realize your idea by following these steps:

  1. Import your Markdown files into Joplin.
  2. Export your files from Joplin, and the application will automatically generate a local folder to save images.

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