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

Added Local images plugin. #492

Merged
merged 4 commits into from
Oct 12, 2021
Merged

Added Local images plugin. #492

merged 4 commits into from
Oct 12, 2021

Conversation

aleksey-rezvov
Copy link
Contributor

@aleksey-rezvov aleksey-rezvov commented Sep 22, 2021

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/aleksey-rezvov/obsidian-local-images

Release Checklist

  • I have tested this on Windows, macOS, and Linux (if applicable)
  • My GitHub release contains all required files
    • main.js
    • manifest.json
    • styles.css (optional)
  • GitHub release name matches the exact version number specified in my manifest.json (Note: Use the exact version number, don't include a prefix v)
  • The id in my manifest.json matches the id in the community-plugins.json file.
  • README clearly describes the plugins purpose and provides clear usage instructions.
  • I have added a license in the LICENSE file.

@brimwats1
Copy link

you forgot the link to your plugin! :)

@aleksey-rezvov
Copy link
Contributor Author

you forgot the link to your plugin! :)

yes, I focused too much on the checklist )

Added the link now

@lishid
Copy link
Collaborator

lishid commented Sep 27, 2021

https://github.com/aleksey-rezvov/obsidian-local-images/blob/64fce86c9b09783cca77f6f6d83e6d3514f30d15/src/main.ts#L70
Might not be a good idea to process all files in the vault simultaneously. I suggest running this one after another (awaiting the promise) rather than parallel. For added user experience, you can create a modal that shows how many files are being processed, and continuously update the count until the process is over, using notice.setMessage(text). I forgot to add the function to the API list but it's there and you can call it with // @ts-ignore.

@aleksey-rezvov
Copy link
Contributor Author

https://github.com/aleksey-rezvov/obsidian-local-images/blob/64fce86c9b09783cca77f6f6d83e6d3514f30d15/src/main.ts#L70 Might not be a good idea to process all files in the vault simultaneously. I suggest running this one after another (awaiting the promise) rather than parallel. For added user experience, you can create a modal that shows how many files are being processed, and continuously update the count until the process is over, using notice.setMessage(text). I forgot to add the function to the API list but it's there and you can call it with // @ts-ignore.

Yes, I checked it only with a small number of pages, probably if we talk about hundreds or even thousands of pages, parallel processing may be a problem.
I will try found some time to do it.

@aleksey-rezvov
Copy link
Contributor Author

https://github.com/aleksey-rezvov/obsidian-local-images/blob/64fce86c9b09783cca77f6f6d83e6d3514f30d15/src/main.ts#L70 Might not be a good idea to process all files in the vault simultaneously. I suggest running this one after another (awaiting the promise) rather than parallel. For added user experience, you can create a modal that shows how many files are being processed, and continuously update the count until the process is over, using notice.setMessage(text). I forgot to add the function to the API list but it's there and you can call it with // @ts-ignore.

I've done described behavior, now it looks like this:

@lishid
Copy link
Collaborator

lishid commented Oct 5, 2021

Looks good! I think the description might have some error in it and I'm having a hard time understanding it:

Searches your notes for hotlinked images, downloads, saves them locally than fix tags in md-files.

Perhaps try to rephrase it? I don't really understand what you mean by "than fix tags in md-files"

@aleksey-rezvov
Copy link
Contributor Author

Looks good! I think the description might have some error in it and I'm having a hard time understanding it:

Searches your notes for hotlinked images, downloads, saves them locally than fix tags in md-files.

Perhaps try to rephrase it? I don't really understand what you mean by "than fix tags in md-files"

Ok, I will try to rephrase, I am not a native speaker with lack of practice, sorry )

@aleksey-rezvov
Copy link
Contributor Author

I've updated README and description in manifest.json:

Local Images plugin finds all links to external images in your notes, then downloads and saves images locally, and finally adjusts the image links in your notes to point to the saved image files.

@lishid lishid merged commit c6c8d2a into obsidianmd:master Oct 12, 2021
@lishid
Copy link
Collaborator

lishid commented Oct 12, 2021

That's much better!

@aleksey-rezvov
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants