obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Provide dataview of individual tagged lines

Open gammak opened this issue 4 years ago • 8 comments
trafficstars

Hi there, I am super excited about Dataview, it's already revolutionized my workflow. One question, though, is whether there's planned support (or already existing support) for dataviews of individual lines/headings based on tags? For instance, one of my common workflows looks like:

# Today's Note

## Tale of Two Cities #reading
- conflagration #worddefinitions
- [ ] Read 'War and Peace' #books
- France is wild

## Harry Potter #reading
- [ ] Check out 'Lord of the Rings' #books
- Muggle #worddefinitions

Ideally, I'd love to be able to set up queries in the following forms:

Reading:
'''dataview
sections from #reading // or something similar
'''

which could return something like:

Reading:

  • TodaysNote/Tale of Two Cities
  • TodaysNote/Harry Potter

(where each of thes is a link to the relevant heading, to deep-dive).

Also useful would be querying individual lines for tasks or tags, e.g.

Words:
'''dataview
list lines from #worddefinitions
'''

or

Books:
'''dataview
list tasks from #books
'''

to get references to those individual lines, a la:

Words:

  • conflagration
  • Muggle

Books:

  • [ ] Read 'War and Peace'
  • [ ] Check out 'Lord of the Rings'.

The existing page-based linking is super helpful for lots of cases, but for those small thoughts that don't have their own page, it'd be great to collate them as well.

gammak avatar Feb 28 '21 01:02 gammak

So to be precise, you're looking for per-"block" (to use Obsidian parlance) queries? That is on my TODO list (exposing blocks as something you can query over, similar to being able to query over individual tasks), I'm mainly just looking at figuring out the right syntax.

blacksmithgu avatar Mar 01 '21 22:03 blacksmithgu

Yep, that sounds spot on, great to hear it's already being thought about! Thanks for the great work!

gammak avatar Mar 04 '21 03:03 gammak

Glad to see this is being considered! I've had basically the same idea of wanting to be able to list all lines/blocks with a given tag at the end (say, "#todo" or "#todo/now") so I can have auto-updated lists of different types or priorities of tasks.

Example:

- Read book
  - Read chapter one #todo/now
  - Read chapter two #todo

would have one task listed under #todo/now and two listed under "todo"

Loving the plugin so far! Keep up the great work.

savvyslog avatar Apr 17 '21 21:04 savvyslog

Ah, excellent, I'm glad to hear this is on the roadmap! For my use case, I'm importing my highlights from Readwise, and I'd like to be able to query for them individually (say, to pick one at random to display). They import as list items, with each book/article/etc. getting its own page.

Peeja avatar Oct 21 '21 23:10 Peeja

You can now query lists and check for the tags in each list item. Can we consider this done?

AB1908 avatar Oct 18 '22 22:10 AB1908

You can now query lists and check for the tags in each list item. Can we consider this done?

What about querying normal lines? I'd like to be able to put tags or dataview fields anywhere to mark it as "needs work", so I can make a query and see only the lines in a document that needs work.

lullinglore avatar Feb 27 '23 20:02 lullinglore

@Lulullia that is much harder to implement as it would require parser extensions. The native search plugin allows for this, however.

AB1908 avatar Feb 28 '23 08:02 AB1908

I would still love to see this. You currently can't query for individual headings, only tasks or lists. I have a lot of notes with tagged headings, so I'd love to be able to gather these into a single view.

musjj avatar Jan 08 '25 18:01 musjj