mrjackphil / obsidian-text-expand

A simple text expand plugin for Obsidian.md
186 stars 12 forks source link

How can I search only the notes that are current, please? #61

Closed MILKMILKKING closed 2 years ago

MILKMILKKING commented 2 years ago

Thank you for your efforts! How can I search only the notes that are current, please?

MILKMILKKING commented 2 years ago

What I specifically want to ask is how to search out a block citation link for the current note, e.g. [[note#^bqzwg]] [[note#^asdfgh]]

mrjackphil commented 2 years ago

@MILKMILKKING You can turn off Exclude current note option in settings. After that you can specify the note using query path:NAME_OF_THE_CURRENT_NOTE.

MILKMILKKING commented 2 years ago

@MILKMILKKING You can turn off Exclude current note option in settings. After that you can specify the note using query path:NAME_OF_THE_CURRENT_NOTE.

@mrjackphil Can you teach me what the exact search code is? Specifically, I want to search for passages in the current note that are marked with blockquotes. For example, if a paragraph ends with ^aa111, ^aa222, how can I aggregate these marked paragraphs together and display them as ! [[#^aa111]], ! [[#^aa222]]? If this could be done, I would be able to put this code at the beginning of the note and automatically generate the paragraphs referenced in this note block.

mrjackphil commented 2 years ago

@MILKMILKKING Grab latest version of the plugin - 0.10.5

Let's assume you have file Untitled.md with blocks.

And you have blocks in this file:

This expand:

path:Untitled
!$blocks

Should provide result as below:

![Untitled#^block1]
![Untitled#^block2]
MILKMILKKING commented 2 years ago

@MILKMILKKING Grab latest version of the plugin - 0.10.5

Let's assume you have file Untitled.md with blocks.

And you have blocks in this file:

  • One line ^block1
  • Another line ^block2

This expand:

path:Untitled
!$blocks

Should provide result as below:

![Untitled#^block1]
![Untitled#^block2]

Thanks for your patient reply, I tried it and found two problems.

  1. notes with Chinese titles cannot be displayed. 2, with the English title notes, you can show the search results, but it is like this:! (Untitled#^block1) image image
mrjackphil commented 2 years ago

@MILKMILKKING Which plugin version? Can you grab the latest version and try again?

MILKMILKKING commented 2 years ago

Sorry I didn't upgrade just now, I've upgraded to version 0.10.8 now, but the search results are still not perfect. It now shows the block references in the notes, but there is another problem.

  1. some of the block references are not rendered. 2, the split characters keep appearing every time the notes are opened (this should be set by me). But my vision is that there should be only one search result at a time.

Every time I close and then open the note again, there will be an additional paragraph <-->123 This marker image image

mrjackphil commented 2 years ago

@MILKMILKKING Oh, wow. Something unusual. Can you provide a small .zip file with reproducible issue?

MILKMILKKING commented 2 years ago

OK, should I send you the test document with questions? How should I send them to you? This is my setup screen, I have set Line ending to ----, but I don't know why the mark <-->123 keeps appearing. image image

MILKMILKKING commented 2 years ago

I'm very sorry to have taken up so much of your time, after I kept trying, I finally rebooted and found the problem all solved! All is fine now. I would like to ask one more question, how can I add a line break to the search results? This is the search result after reboot, everything is fine. image

However, the displayed results are crammed together into one big paragraph, and it would look easier if you could add a line break to each result. image

MILKMILKKING commented 2 years ago

😂 That will do it. path:Untitled