This is a fork of super-simple-plugin designed to provide out-of-the-box easy summaries based on tags within tracking records. The motivation for this fork comes from the need for straightforward time tracking with easy summaries and total time calculations. While the original plugin aimed to remain 'simple' and could achieve these features through dataview, I believe that native summary features offer a more user friendly solution."
- Execute the
Tag Based Time Tracker: Insert Time Tracker
command to start logging. - Set your tags in the settings in YAML format:
streams:
name: "๐ Streams"
items:
- topic: "Accounting"
icon: "๐งฎ"
tag: "#tt_accounting"
subTags: []
- topic: "Development"
icon: "๐"
tag: "#tt_dev"
- Execute
Insert Time Tracking Summary
to get a summary for the desired time interval.
A time tracker is essentially a special code block that stores information about the times you pressed the Start and End buttons. Since time is tracked solely through timestamps, you can switch notes, close Obsidian, or even shut down your device completely while the tracker is running! When you come back, your time tracker will still be running.
The tracker's information is stored in the code block as JSON data. The names, start times, and end times of each segment are stored and displayed neatly in the code block in preview or reading mode.
-
Time Tracking Entries with Tags: Track work sessions with tags to categorize different activities.
- Example of an entry:
#tt_dev #tt_client_a #tt_frontend
represents time spent working on frontend development for a specific client.
- Example of an entry:
-
Enhanced Reporting Functionality: Generate time tracking reports for specific time periods, allowing detailed insight into how time was allocated.
- Topic-based Reports: View summaries of time spent based on specific topics, such as Development, Accounting, etc.
- Multiple Parallel Topics Possible: Track multiple dimensions.
- Subtags: Track specific tags and group time tracking summaries in a markdown file. This will generate a report for a given period, optionally filtered by a specific topic.
# You can have as many 'sections' as you want to track different domains separately or in parallel
# Example section / topic 1
streams:
name: "๐ Streams"
items:
- topic: "Accounting"
icon: "๐งฎ"
tag: "#tt_accounting"
subTags: []
- topic: "Development"
icon: "๐"
tag: "#tt_dev"
subTags:
- topic: "Frontend"
tag: "#tt_frontend"
subTags: []
- topic: "Backend"
tag: "#tt_backend"
subTags: []
# Example section / topic 2
clients:
name: "๐จ๐ผโ๐ผ Clients"
items:
- topic: "Client A"
tag: "#tt_client_a"
subTags: []
- topic: "Client B"
tag: "#tt_client_b"
subTags: []
Tag Based Time Tracker has a public API that can be used with Dataview, specifically DataviewJS, which can be accessed using the following code:
dv.app.plugins.plugins["tag-based-time-tracker"].api;
The following is a short example that uses DataviewJS to load all trackers in the vault and print the total duration of each tracker:
// Get the time tracker plugin API instance
let api = dv.app.plugins.plugins["tag-based-time-tracker"].api;
for (let page of dv.pages()) {
// Load trackers in the file with the given path
let trackers = await api.loadAllTrackers(page.file.path);
if (trackers.length)
dv.el("strong", "Trackers in " + page.file.name);
for (let { section, tracker } of trackers) {
// Print the total duration of the tracker
let duration = api.getTotalDuration(tracker.entries);
dv.el("p", api.formatDuration(duration));
}
}