How do I make a (non-JS) Dataview table with all the highlighted texts in my notes?

Can someone help me write a non-js Dataview query that creates a table of all notes that contains texts with the highlight toggled on (shown as yellow)?

I do this sometimes in my documents, to remind me of things I should do or change, but I rarely find it again. I haven’t found a good solution yet for structuring this workflow so I’m hoping to create a Dataview setup.

I don’t believe it’s possible to query for notes with specific markup.

Have you considered tagging documents after highlighting. That would make it easy to query. (Not ideal to have this 2nd step, but it makes the query easy.)

Strange that Dataview is weak in simple things. :wink:

I could mark the files with “==” but that would be my ‘dumb’ solution. I was hoping for a smart solution, but what can you do if it’s not possible…

In my perception, Dataview is strong at treating metadata, and querying on those. You’re talking about textual data and markup, and that is another beast all together.

I think using the search query syntax will be a better tool for this kind of search, maybe something like the following:

```query 
/==.*?==/
```

In my test vault some of the first entries for this query are:

1 Like

Another alternative solution would be to use inline fields, possibly with dedicated styling to emphasize the task at hand.

I’m thinking markup like the following:

Kimg Edward, born in 18?? (todo:: When was he born? ), was a king...

This is possible to style according to your liking, and is easily retrievable in a Dataview query.

2 Likes

Thanks, Holroy, both are great solutions. The search query works well enough for me. All I want is a list of highlights and this does the job.
I thought primarily of Dataview, because I use it for most lists and searches, but this is equally good. :wink:

The inline field is also a good idea. This makes it even clearer why you even marked it in the first place. I find this happens to me quite often, that’s why I wanted to run through all of my highlights to see what needs to be done.

With that in regard, I have another question:
How would you put the inline fields in a Dataview query? I’d like to have a table with the link to the note AND the todo:: field + text shown.

I’m even thinking of combining your both solutions, by putting the original text and the todo:: between parentheses. That way, when I query it, it shows both and I have a clear idea of what I need to change.

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