-
Notifications
You must be signed in to change notification settings - Fork 76
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
How does highlighting work in promnesia ? #284
Comments
I am using the "auto" indexer to index the files : from promnesia.common import Source
from promnesia.sources import (auto)
SOURCES = [
Source(
auto.index,
'/path/to/files',
)
] |
Hi! So it doesn't really depend on the indexer, and kind of 'expected' behaviour at the moment. And also it does it on line by line basis, that's why your first example
, I think I'd expect it to start working -- so it's not really about org mode or markdown :) The reason it's implemented that way is to keep the highlight implementation simple, since I didn't want to reinvent the wheel (it's fairly short, see here promnesia/extension/src/sidebar.js Lines 241 to 259 in 4443d81
Implementing highlights properly would be pretty hard -- basically highlighting the exact match within text would require detecting exact text boundaries properly, and then wrapping the text in some sort of Ideally it would be nice to reuse some existing library (like Hypothes.is annotator). Also see relevant issue #30 |
Ah, I see. Yeah, you are right. The second example does indeed highlight. Thanks! I am totally okay with it highlighting the entire outerHTML. Finding and highlighting the exact text does indeed seem challenging. |
Just wanted to add that perhaps mark.js might also be an alternate way to achieve this. |
@Stvad suggested this https://github.com/GoogleChromeLabs/text-fragments-polyfill (although not sure if it's suitable for matching longer bits of hihglight) |
Not entirely sure what do you mean by that |
As in, I only seen text fragments work for short snippets (e.g. when you jump from google search). Not sure how well it would work if you clipped several paragraphs of text (promnesia would handle it correctly and highlight multiple paragraphs). |
hmm, my expectation is that it should work just fine. I liked this write-up on fragment links: https://web.dev/text-fragments/ also you can just try it with https://github.com/GoogleChromeLabs/link-to-text-fragment extension |
Hi,
This is also related to #244.
Here's a webpage: https://en.wikipedia.org/wiki/Wiki.
Let's say I want promnesia to highlight the following text:
Wikis are enabled by wiki software, otherwise known as wiki engines.
How should my notes be formatted such that promnesia is able to highlight that particular text/section?
Here are a couple of things I tried:
[test-wiki](https://en.wikipedia.org/wiki/Wiki) : Wikis are enabled by wiki software, otherwise known as wiki engines
I am able to get promnesia to highlight the entire paragraph :
Is there a reason why this does not work for markdown?
Thanks!
The text was updated successfully, but these errors were encountered: