Is it possible to get the "paragraph" that has [[link-to-note]] using dataview?

WHAT I’M TYRING TO DO

I have a file I-mentioned-this-file.md that look like this:

// I-mentioned-this-file.md sample
# h1
here I mentioned [[the-file]] once.

## h2
I miss [[the-file]] again

And I was trying to get all links to the current file(this-file.md) with dataviewu using this query :

dv.list(
  dv.pages(`[[${this.currentFilePath}]]`)
    .map(page => page.file.link))

which would results lists of titles of links like the following.

  • [[I-mentioned-this-file]]

But actually in file I-mentioned-this-file.md, I have multiple mention parts, and I want to show them individually.

DESIRED OUTPUT

// I want the result looks like this
// in `link + " :: " + paragraph`  format
- [[I-mentioned-this-file]] > h1 :: here I mentioned [[the-file]] once.
- [[I-mentioned-this-file]] > h2 :: I miss [[the-file]] again

THINGS I’VE TRIED

I’ve found out if you mentioned in lists - [[this-file]] is mentioned, you can they query using file.lists.sections and file.lists.text.

But I really dont find a way to get text of the linked paragraph.

How can I imporve the query?

It’s not possible to retrieve any paragraph content with DataView.
You can use javascript using DV API.

I have tinkered with this kind of before on occasions but my javascript is probably bulky or unclean (but functional and not destructive in any way):

There have been at least 2-3 similar requests in the Help section in the last couple of months but they elude me now.

built in search block:“[[link-name]]”

Also, the linked mentions at the bottom of that note will list all blocks to that note.

Cannot copy content to another note or integrate in any way currently, unfortunately.

  • Although inline queries can be used, granted.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.