Is there a way to dynamically reproduce whole paras featuring a tag or link?

Hi there,

I am wondering if there is a plugin or shortcut/code (possibly using dataview) that I’m not aware of that will allow the user to produce a list of all paragraphs that contain a specific internal link or tag?

For example, I want to have a note that contains everything I have read or written about #accountability or [[accountability]]. At the moment, I have created a note called ‘Accountability’ and then every time I come across something to do with the topic of accountability I embed an internal link to the specific para - i.e. ![[link^para]]. The Accountability note is then a central location for everything about the topic. I don’t want a list of other notes but to embed specific paragraphs because often a literature note may be relevant to many topics, not just accountability.

Ideally, as I tag or link to accountability content the Accountability note automatically updates. Basically, like my current system, without the need to manually add an internal link to a specific para each time I come across relevant content. But, instead, the accountability note is updated based on a specific tag or internal link.

Alternatively, is there a shortcut way to quickly link to a specific para without having to find the specific para by scrolling through text or typing part of the para after typing ^.

Sorry, instead of referring to ‘paras’ I should have said ‘blocks’.

1 Like

hi @aarontimo, i think what u need can be achieved with obsidian query function. but to add useful feature like showing in rendered markdown and controlling some other elements, you can try to use Query Control plugin for that (but u need to install using BRAT)

here’s an example for reference

```query
block: ([[Ipsum]]) OR #ACMECorp 
title: My Search on Ipsum and ACMECorp
collapsed: false
context: true
hideTitle: false
renderMarkdown: true
```

3 Likes

:exploding_head:

This is exactly what I was looking for/needing. This is going to save me an incredible amount of time. Thank you!

Silly question, but how would you exclude maps of content? I tried:

block: ([[market accountability]]) OR #market_accountability AND !#MoC
title: Market Accountability References
collapsed: false 
context: true 
hideTitle: false 
renderMarkdown: true

but it removed a note that didn’t have the tag #MoC

Thanks again. This is fantastic!

I’m not too fluent with query syntax (using it occassionally), but this should work.
block: ( [[market accountability]] -#MoC ) OR #market_accountability

here are as far as i know how to use query syntax

  • ( [[link]] -#tag1) OR #tag2 will find all notes with [[link]] that doesn’t have #tag1 and then include all notes that have #tag2 (that may still have #tag1 in the same note as #tag2)
  • ( [[link]] OR #tag2 ) -#tag1 will find all notes that has either [[link]] or [[#tag2]] and then remove from that list any notes that have #tag1
    • which should be similar to ( [[link]] -#tag1 ) OR ( #tag2 -#tag1)
block: ( [[market accountability]] -#MoC ) OR #market_accountability
title: Market Accountability References
collapsed: false 
context: true 
hideTitle: false 
renderMarkdown: true

don’t use the AND operator. i don’t know how it works but it seems to make the variable being excluded for all notes. perhaps mod or others can shed some light

1 Like

Hi @aarontimo,

Unsure if I’m late to the party and have fully found what you want, but I do something similar with a template.

I have created a template that I use when needed inside MOCs that basically takes the title and adds a dataview search based on the title

LIST
FROM "Creation" AND !outgoing([[]])
WHERE any(contains(file.tags, replace(replace("interests/{{Title}}","🍱- ",""), " MOC", "")),contains(file.tags, replace(replace("concept/{{Title}}","🍱- ",""), " MOC", "")))
SORT Created desc

Let me explain it briefly.

Block Analysis

LIST

It creates a LIST

FROM

For anything inside my Creation folder
That is NOT already in this file (that way I can avoid links that are already tracked in this file)

WHERE

It looks for any file that contains either

  • #interests/topic
  • #concept/topic

Note: Since my MOCs files all have the following name :bento:- Title MOC (Example of my mocs: [[:bento:- Distractions MOC]], [[:bento:- Dopamine MOC]],…) I wrote a small function to remove the bits that surround the key words.
:bento:- Title MOC → :bento:- Title MOC → Title

SORT

Order with most recently created first

Wrap-up

I have that code repeated 4 times, to search in my 4 main folders:

  • My digital Garden
  • My To-Read List (Anti-Library)
  • My Library (Processed stuff)
  • My Brain Dump (Items I tagged but have not even curated)

Example with low entries

Example with already curated subject (Drawing) showing pending items that have not yet been classified in the note

For searching tags it’s better to use tag:MoC instead of #MoC. It’s faster because it searches the tag index, it avoids false positives (#MoC will match anything that starts with it, like #moccasins), and it matches tags in YAML metadata.

(I may have more later but this is all I have the bandwidth for now.)

1 Like

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