akaalias / extract-highlights-plugin

Manage your highlights in Obsidian by easily creating, removing and exporting them.
88 stars 8 forks source link

Allow to copy the full paragraph containing the highlight when extracting it #6

Closed ngirard closed 3 years ago

ngirard commented 3 years ago

Hey Alexis, thank you for your work and your catching enthusiasm !

There's one feature I'd greatly benefit from if you added it to your plugin. I do use highlighting to delimit the passages that trigger my interest when reading, then I follow pretty much the same workflow as the one you describe ; but most often I find that only extracting the highlighting doesn't carry enough context. Thus, for each highlight, I manually extract the whole paragraph containing it. It find it great if you could allow it with your plugin.

Let me take an example for illustration. Here's some text comprising one highlight:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, ==quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat==. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

My proposal is to allow the created note resulting from your "text exploding" process ton contain:


## Source

> Ut enim ad minim veniam, ==quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat==. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

instead of just


## Source

> Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Obviously, the generated title for that note would stay just the same.

Cheers !

akaalias commented 3 years ago

Ah, very interesting! That may be doable and I see the value of retaining context. This would capture the whole line/paragraph, not just the highlighted part... Let me look into it in the coming days and give you an update here. Thanks! Cool idea!

ngirard commented 3 years ago

Great, thanks !

akaalias commented 3 years ago

The more I think about this, the more I really, really like it.

I'm going to spend some time today to see how much work this is and keep you posted.

A few edge-cases for us to think about:

What should happen when you highlight across two paragraphs like so:

Lorem ipsum dolor sit amet, ==consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat==. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

...and what about when highlighting a bullet list item?

- Lorem ipsum dolor sit amet, ==consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore== magna aliqua.
- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

What do you think and what are other edge-cases you can imagine?

akaalias commented 3 years ago

Also:

Obviously, the generated title for that note would stay just the same.

Lol, "obvs" Good catch!

akaalias commented 3 years ago

Added! Please update your plugin via Obsidian, enable the setting (It's off by default) and lemme know how it goes!