svsool / memo

Markdown knowledge base with bidirectional [[link]]s built on top of VSCode
https://marketplace.visualstudio.com/items?itemName=svsool.markdown-memo
MIT License
819 stars 48 forks source link

Backlinks: show surrounding context #104

Open srid opened 3 years ago

srid commented 3 years ago

The extension's backlinks panel currently displays only context after the link (see https://github.com/svsool/vscode-memo/issues/29#issuecomment-661337531), however in practice the context both before and after the link is relevant when navigating notes by backlinks, especially if the link is used in passing in the middle of a whole sentence (eg: "Here is a sentence which is the whole [[context]] for the link in it"; vscode-memo will display [[context]] for the link in it in backlinks panel, which is obviously incomplete).

svsool commented 3 years ago

What do you think would be a sensible limit for the surrounding context in case of long paragraphs? Showing the whole paragraph/sentence before/after a link might be irrelevant in some cases.

nixsee commented 3 years ago

This seems like a reasonable option. I don't know what a sensible limit would be though - perhaps something that could be user-configurable?

srid commented 3 years ago

Surrounding paragraph with a hardcoded limit that makes sense for UX?

You can checkout the backlinks in https://notes.andymatuschak.org/About_these_notes?stackedNotes=z3SjnvsB5aR2ddsycyXofbYR7fCxo7RmKW2be for some ideas.

This is something I need to figure out for neuron as well, when implementing https://github.com/srid/neuron/issues/190

svsool commented 3 years ago

I need to play around with this idea. For starters, something like "n" words before/after with some reasonable min/max limits in the settings probably would do the thing.

srid commented 3 years ago

I went with the approach of including entire surrounding "block" element, which is usually paragraph or a list item. You can see it in action in any of the neuron pages, eg: https://neuron.zettel.page/cerveau.html

memeplex commented 2 years ago

I left some related remarks in this mostly-dup report of mine https://github.com/svsool/vscode-memo/issues/478.