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


I have a file that look like this:

// 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( with dataviewu using this query :

    .map(page =>

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

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

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


// 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


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.