Closed sonsche closed 2 years ago
Update plugin to 0.10.1
and try $characters:50
.
Thank you for updating it! Unfortunately, now it returns the FIRST 50 characters of the file, not before and after the search term :/
So I mostly get metadata:
@sonsche Try $matchline
Still not working... Like this?
wahrheit
^|Filename|Content|
^|---|---|
|[[$filename]]|$matchline $characters:50|
The search term is highlighted now though :)
@sonsche Can you provide a little .zip
with minimal reproducible issue?
$matchline
returns the paragraph which might be not enough for your use case.
You can remove $characters:50
when you use $matchline
I'll keep this issue opened until we can handle this issue.
Here are a few pages where I've tested $characters:50
, $lines:2
and $matchline
. I tried it out in a new vault without any plugins and unfortunately no luck. And the $lines:2
output also changed a lot since the update, now giving out lines from the top of the file with metadata.
Thank you again for taking the time!
@sonsche Just pushed 0.10.7 which has some limit functionality for $matchline
.
Syntax works like that: $matchline:2:100
which means:
It's very dirty. I should rethink the way this plugin was implemented. I didn't think what someone will use this plugin.
I am realizing that it might have been a naive to assume that it would be possible to "just print" the context that the original search is showing. Although I admit that my use case might be a bit specific...
The good news: the table looks great now! The bad news: the results don't always show the search result, but probably the beginning of file which is the beginning of the "line". And strangely, the highlight is not visible in the active note, but shows up if I print to PDF --- but that seems to be a separate problem with the table formatting.
matchline:1:200 works, matchline:2:100 not so much
expand_matchline 1-200 .pdf expand_matchline 2-100 .pdf expand_matchline 0-100 .pdf
@sonsche
0.10.8 just landed. Try:
wahrheit
^|Filename|Content|
^|---|---|
|$link|$searchresult|
So added the new sequence $searchresult
.
Brilliant, I can work with this! The table formatting is still wonky (probably nothing to do with the expander), so I will just create a regular list. I can get a week's work done in a day! <3 Thank you so much!
The sequence $lines:## returns too much text for me, since I am searching in big text blocks without line breaks. Too much text seems to break the table syntax. And it often only returns “—” .
Could a sequence be added that only returns a certain number of characters before and after the search term? It would really save me a LOT of time copying and pasting text snippets.
Edit for more info:
Because the notes I search in are longform text and have few linebreaks,
$lines:1
will give me a lot of text that seems to break the table formatting, or it will return no text at all, just "---" :1.) too much text![Obs_expand_too much text](https://user-images.githubusercontent.com/104635900/166097754-1bc84a40-16e5-4617-b48e-2513c5e44272.JPG)
2.) no text (and file 151_c23 does not contain the search term)![Obs_expand_no text](https://user-images.githubusercontent.com/104635900/166097907-4a44f8c9-c4f7-4c1d-b041-ca0be2ec779b.JPG)
Would it be possible to have a sequence
$characters:10
to just show a custom number of characters for context, like in the original Obsidian search, like this?Thank you very much for your work!!