Skip to content

Add Raindrop Highlights Plugin #1096

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

Merged
merged 2 commits into from
Aug 31, 2022
Merged

Add Raindrop Highlights Plugin #1096

merged 2 commits into from
Aug 31, 2022

Conversation

kaiiiz
Copy link
Contributor

@kaiiiz kaiiiz commented Aug 5, 2022

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/kaiiiz/obsidian-raindrop-highlights-plugin

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.

@liamcain liamcain self-assigned this Aug 31, 2022
@liamcain
Copy link
Collaborator

Hi, Just a few small nits but I think this can go in. Is there any reason you opted to create a separate plugin instead of collaborating with the other Raindrop plugin author?


@liamcain liamcain merged commit d09ba96 into obsidianmd:master Aug 31, 2022
@kaiiiz
Copy link
Contributor Author

kaiiiz commented Sep 3, 2022

Is there any reason you opted to create a separate plugin instead of collaborating with the other Raindrop plugin author?

To be honest, this is because I think the other Raindrop plugin is developed in a very slow progress and without active maintenance. There are lots of issues without response and the plugin was submitted to obsidian-releasees at Mar 22 but still not be accepted.

In the meantime, I'm tired of repeating the copy-paste highlight procedure from Raindrop to Obsidian, so I decided to implement this feature according to my needs. The original Raindrop plugin is more focused on the dataview-like features, but Raindrop Highlights will mainly focus on the note creation features.

message += ${collection.title}: ${collection.lastSyncDate?.toLocaleString()}\n Small nit: You might want to add each entry into a list, then you can do collectionEntries.join('\n'). That way you don't end up with a trailing newline. It's also more efficient that doing intermediate string concatenation

I've refactored it to a more functional programming way.

Link Super small nitpick but obsidian commands are "Sentence-case" so it would make more sense not to capitalize each word in your commands.

Thanks for the suggestion. I've fixed it.

this.localStorage = window.localStorage; Why are you storing a reference to localstorage?

Yes, this is unnecessary. I've removed it.

const filecontentLine = content.split("\n"); on large files, this can be pretty inefficient. You might want to consider just searching for \n---\n and splitting at that index.

I've refactored this using indexOf to find the split position of the frontmatter and the content. I think this implementation is better than before, which doesn't require the linenumber-sized of array, splice and join process.

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

Successfully merging this pull request may close these issues.

2 participants