question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Burning out" dataviews

See original GitHub issue

I’ve started using dataviews in my daily notes via the daily note template. One dataview I’m using lists all the notes I edit that day:

list from "some-folder"
where file.mtime.day = date({{date:YYYY-MM-DD}}).day and file.mtime.month = date({{date:YYYY-MM-DD}}).month and file.mtime.year = date({{date:YYYY-MM-DD}}).year 

That ends up inserted in my daily note as a dataview that matches any files edited today. It’s very useful. However, if I edit a file after that day, the list stops showing it, even though I edited a file on that day. Because I’d love to have a history of the files I’ve worked on for any given day, I need some way to “burn out” a dataview—effectively replace its code fence with its markdown result.

I can see this being a button that appears on hovering the code fence when in preview mode, or even a command in the command palette that operates on the dataview under the cursor. Even better would be a way to bake this into the dataview so that it happens automatically after a certain threshold, e.g.

list from "some-folder"
where file.mtime.day = date({{date:YYYY-MM-DD}}).day and file.mtime.month = date({{date:YYYY-MM-DD}}).month and file.mtime.year = date({{date:YYYY-MM-DD}}).year
burnout after {{date:YYYY-MM-DD}}

but I have no idea if such a thing is technically feasible, as I haven’t dug too deeply into Obsidian’s internals. Either way, a way to go from a dataview query to its hardcoded result would be very useful to freeze documents in time.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:48
  • Comments:94 (17 by maintainers)

github_iconTop GitHub Comments

29reactions
blacksmithgucommented, Feb 14, 2022

Alright, so I’m finally around to looking at this again. I have two modes which I am planning on supporting directly right away:

  • Preview mode: All dataviews will support both “Export to Markdown” and “Freeze as Markdown”, which (1) copy markdown for you to paste, and (2) directly replace the query block with markdown. This requires manual action to freeze but at least enables the core functionality.
  • Bulk Freezing: Dataview will provide a simple UI for replacing ALL queries in your vault with their static results in one atomic operation - best for if you are migrating away from Obsidian or Dataview but want to keep all of your tables and indices. This will also support the ability to keep the existing Dataview block and just append the result as Markdown after the block.

These two scenarios should unblock the most important use-cases: data archiving, basic view support in publish and GitHub, migrating away from Dataview, and even being able to see important Dataview-based links in the graph. I can also consider implementing “Bulk Freezing” as a simple automatic job that runs at user-defined intervals or on important operations.

24reactions
blacksmithgucommented, Mar 19, 2021

It’s doable, and I’ve had a few people ask about it for another application (Obsidian Publish). Will add support for it in an upcoming release (likely by having it replace or append the fully rendered HTML for tables, and Markdown for everything else).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with Plugins like Dataview : r/ObsidianMD - Reddit
Which means if I want to move off of dataview in the future, ... concerns like that haven't been burned once twice thrice...
Read more >
Dataview Plugin - Joschua's Garden
Dataview Plugin - Joschua's Garden. ... The links introduced through dataview are not Obsidian notes, so don't show up in ... "Burn out"...
Read more >
Looping through rows in a DataView - Stack Overflow
The DataView object itself is used to loop through DataView rows. DataView rows are represented by the DataRowView object. The DataRowView.
Read more >
Are Your Employees Burning Out? - Kaggle
Understand if your employee will Burn Out using the Burn Rate Dataset.
Read more >
When COVID's Work-From-Home Burnout Doesn't Let Up
Many people who started working from home during the pandemic are experiencing stress and exhaustion. Get expert advice for handling this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found