I’m a lazy note-taker, so I keep a daily note in which I collect everything that wants out of my head.
The “log” (Logbuch in my native German) is exactly that heap. Mostly I use it for notes on programming, where I need a short note plus a screenshot. It has the form:
- (Logbuch:: <some_word>) #tag_for_project entry text, possibly with further #tags - childentry with text and yet more tags - Screen:: ![[some_image]] - another child with text
My current query flattens file.lists into L and spills out the rows.L.text, rows.L.children. Good enough for the text entries. Unfortunately it drops dead on the images.
TABLE rows.L.text as Text, flat(rows.L.children,2).text as Kommentar FROM #Logbuch and #tag_for_project FLATTEN file.lists AS L WHERE file.lists WHERE meta(L.section).subpath = "Logbuch" WHERE contains(L.tags, "#tag_for_project") group by file.link as Datum sort date(file.ctime) desc
As you can see, the fields “Screen” are rendered with the sizing information as text only. That’s somewhat annoying. If I just have a ![[some_image]] on that line without any size or as value of key “Screen::”, Dataview renders it quite nicely, but that’s not what I want.
Well, I’m not easily scared, so I tried regreplace’ing within the line containing an image, simply using choice to either embed or render the text, codediving into Dataview, even things not talked about in polite society such as this.
All because I couldn’t get the function “extract” to work and didn’t find anybody using it at all, much less an example. Link to documentation: Functions - Dataview
Now I’m so censored, that I’m ripe to call on you folks for help
So, if anybody could (pretty please!) explain that function to me or show me a working example, I’d be grateful. And my neighbours would add their thanks, just to be relieved of the blue air here.
What I want is a table with ID, that contains the field “Text” and a proper representation of the value of “Screen” in the children.
P.S.: I don’t want to use JS. That would be cheating