blacksmithgu / obsidian-dataview Public
generated from obsidianmd/obsidian-sample-pluginNew issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block/heading queries #30
Comments
|
I'm currently working on fancy new query syntax for block/section-level queries (as well as link-based queries). Do you have any examples in mind, so I can make sure it's supported? |
|
Not sure if this fits into blocks/section-level but a use-case I have is that I define events across random files as list items: Those files may contain all sorts of other content surrounding the list items, and the list items could be spread out across each file. From there I'd like to pull those line-items into a consolidated list somewhere else. This is how I currently do it with the official query syntax (removed backtick to show as code): Or if I wanted to only show line-items relating to this month: The problem with the built-in queries is that the output is noisy and cumbersome and cannot be configured, unlike Dataview. |
|
Here's an example - I have a morning checklist in my Daily notes With Dataview i could do some analytics on how often I'm actually doing stuff if that makes sense. Could sub stratify on vitamins or health in general, for example |
|
I am stubbornly attempting to replicate how, in Roam Research, you dump notes into your Daily Note like so:
Then on a Quotes page, I would use a dataview to pull all the lines tagged #quote and display them, ideally grouped by secondary tags. On my Productivity MOC, I'd have:
The latter three are technically possible with the vanilla (The Obsidian expectation seems to be that I create a new page for every single quote, which is cumbersome and would clutter my precious Graph View.) |
|
I am also very interested in this feature. My typical use-case is as follows.
For example, in my daily note I also have a separate note with project-related task queries, where I want to gather tasks not only from project pages directly, but also from all other pages including daily notes. There, I'd like to have the possibility to list tasks of only specific projects. Currently, the following query would return tasks for both projects: as it only checks for link existence, but does not limit the query to a block scope. Not sure about the syntax to specify block scope in such query, though. As was already mentioned above, from the standard that would display But standard It seems that having block scope specification for
|
|
Block/heading queries are high on my TODO list. Support will probably come through DataviewJS first (since it is easier to expose data there), and then in queries via the improved query syntax later. |
|
Will follow as I'm keenly interested in this functionality. Hopefully soon... Thanks a lot for this great plugin! |
|
I am also experimenting with using block ids as a method to store metadata for tasks in yaml instead of inline text. I find putting metadata on same line begins to feel noisy. I found that if the task has a block id I could grab the blockid from the link and store the metadata in yaml. And now I am thinking it would be great if I could add yaml metadata to any block id, but there doesn't seem to be an easy way to query a list of block ids yet. |
|
@kurtharriger I can see same-line metadata being quite noisy - there is incoming support for adding metadata via sublist elements, though that is also a little noisy. Being able to externally store metadata by { file, section, block } ID is an interesting idea - there is incoming support for easily loading YAML data (via |
This would be a big improvement but if you were to do this, wouldn't it be better to index every line? It looks like Obsidian is already doing this. Obsidian has different search operators for |
|
I'm also glad to see this on the roadmap! I'd also like to be able to access Dataview fields on a "per section" basis. My use case is files that contain different sections of the same types of data in them, for example: The goal being to be able to treat "sections" of a file the same way we currently treat files. So in addition to having The DQL, perhaps, could have something like... Not trying to be prescriptive here, just trying to share some thoughts/ideas, since it is such a complicated request as you've noted. I think the biggest complication in my mind is how to deal with the different levels of sections. Some people may want H1, some may want H2... you may actually need to add some kind of dataview field or tag to the header to denote to dataview how the page should be divided into "sections". Or perhaps it only supports it's lowest level section. Thanks so much for your work on this plugin, you've enabled so many of us to supercharge Obsidian. You've done an incredible job! |
|
I'd really like to be able to treat sections as a sort of alternative to objects in YAML. Different levels of headers could denote nesting, for example: # top level:
## middle level:
### bottom level
## middle level 2If there was no middle level, it would go straight to the next one down (the bottom level). |
|
Stoked to see this is in the roadmap. Similar use-case to @evfro here: I'd love to be able to query
Ideally with the ability to filter based on whether the task's child (or parent, or parent file) contains certain metadata (e.g. This would be a gamechanger to my variant of GTD and finally get me off Roam Research! |

It would be great to be able to filter based on block or sections link in the standard search.
The text was updated successfully, but these errors were encountered: