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

Add obsidian-kobo-highlights-importer-plugin #801

Merged
merged 2 commits into from
Mar 9, 2022
Merged

Add obsidian-kobo-highlights-importer-plugin #801

merged 2 commits into from
Mar 9, 2022

Conversation

bitwiseops
Copy link
Contributor

@bitwiseops bitwiseops commented Feb 25, 2022

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/bitwiseops/obsidian-kobo-highlights-import

Release Checklist

  • I have tested the plugin on
    • Windows
    • macOS
    • Linux
    • Android (if applicable)
    • iOS (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.
  • My README.md describes the plugin's purpose and provides clear usage instructions.
  • I have read the tips in https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md and have self-reviewed my plugin to avoid these common pitfalls.
  • I have added a license in the LICENSE file.
  • My project respects and is compatible with the original license of any code from other plugins that I'm using.
    I have given proper attribution to these other projects in my README.md.

@bitwiseops bitwiseops changed the title Update community-plugins.json Add obsidian-kobo-highlights-importer-plugin Feb 27, 2022
@lishid
Copy link
Collaborator

lishid commented Mar 8, 2022

https://github.com/bitwiseops/obsidian-kobo-highlights-import/blob/003b1f028463e99971935195822e602ff7f0f017/main.ts#L35
I recommend setting this up lazily, only when your command is ran. This would speed up the app's boot up process as well as reduce resources needed if your plugin isn't being actively used this session.

https://github.com/bitwiseops/obsidian-kobo-highlights-import/blob/003b1f028463e99971935195822e602ff7f0f017/main.ts#L109
I highly recommend building the whole string in memory and writing it once at the end. Doing it like this would incur many small individual disk writes which is inefficient and also causes things like sync services to repeatedly sync the partial file.

Plus, I don't see the need for FileSystemAdapter here since the methods you're calling aren't specific to that one.

bitwiseops added a commit to bitwiseops/obsidian-kobo-highlights-import that referenced this pull request Mar 9, 2022
@bitwiseops
Copy link
Contributor Author

bitwiseops commented Mar 9, 2022

Hello!

I've just updated my plugin following your suggestions. You can now check if it is okay.

I should maybe clean up my code some more, but I'll do it for next update :)

@lishid lishid merged commit a61ca06 into obsidianmd:master Mar 9, 2022
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

Successfully merging this pull request may close these issues.

2 participants