Skip to content

Commit

Permalink
Prepare to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
serrnovik committed Nov 4, 2024
1 parent ab05c48 commit 059b414
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 107 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

7 changes: 0 additions & 7 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Ellpeck
Copyright (c) 2024 SerrNovik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
143 changes: 54 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,51 @@
# Super Simple Time Tracker
Multi-purpose time trackers for your notes!
# Tag-Based Time Tracker
Multi-purpose time tracker for your notes!

![A screenshot of the plugin in action, where you can see an active time tracker for a project](https://raw.githubusercontent.com/Ellpeck/ObsidianSimpleTimeTracker/master/screenshot.png)
![A screenshot of the plugin in action](reporting-screenshot.png)

# 🤔 Usage
To get started tracking your time with Super Simple Time Tracker, open up the note that you want to track your time in. Move the cursor to the area you want the tracker to reside in, and then open your command palette and execute the `Super Simple Time Tracker: Insert Time Tracker` command.
This is a fork of [super-simple-plugin](https://github.com/Ellpeck/ObsidianSimpleTimeTracker) that has support for out-of-the-box tagging.

When switching to live preview or reading mode, you will now see the time tracker you just inserted! Now, simply name the first segment (or leave the box empty if you don't want to name it) and press the **Start** button. Once you're done with the thing you were doing, simply press the **End** button and the time you spent will be saved and displayed to you in the table.
# TLDR

Need help using the plugin? Feel free to join the Discord server!
1. Execute the `Super Simple Time Tracker: Insert Time Tracker` command to start logging.
2. Set your tags in the settings in YAML format:

[![Join the Discord server](https://ellpeck.de/res/discord-wide.png)](https://link.ellpeck.de/discordweb)

## 🔍 Tracker Data in Dataview
Super Simple Time Tracker has a public API that can be used with [Dataview](https://blacksmithgu.github.io/obsidian-dataview/), specifically [DataviewJS](https://blacksmithgu.github.io/obsidian-dataview/api/intro/), which can be accessed using the following code:

```js
dv.app.plugins.plugins["simple-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. You can also find this example in action [in the test vault](https://github.com/Ellpeck/ObsidianSimpleTimeTracker/blob/master/test-vault/dataview-test.md?plain=1).

```js
// get the time tracker plugin api instance
let api = dv.app.plugins.plugins["simple-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));
}
}
```yaml
streams:
name: "🌊 Streams"
items:
- topic: "Accounting"
icon: "🧮"
tag: "#tt_accounting"
subTags: []
- topic: "Development"
icon: "💗"
tag: "#tt_dev"
```
A full list of the functions exposed through the API can be found [in the code](https://github.com/Ellpeck/ObsidianSimpleTimeTracker/blob/master/src/main.ts#L8-L16). Proper documentation for the API will be added in the future.
3. Execute `Insert Time Tracking Summary` to get a summary for the desired time interval.

# 👀 What it does
A time tracker is really just a special code block that stores information about the times you pressed the Start and End buttons on. 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! Once you come back, your time tracker will still be running.
# Description
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. They're displayed neatly in the code block in preview or reading mode.
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.

# Tim Tracking Summary / Reporting
# Time Tracking Summary / Reporting

1. **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 the development (frontend) for a specific client.
- Example of an entry: `#tt_dev #tt_client_a #tt_frontend` represents time spent working on frontend development for a specific client.

2. **Enhanced Reporting Functionality**: Generate time tracking reports for specific time periods, allowing detailed insight into how time was allocated.

- **Stream-based Reports**: View summaries of time based on specific streams such as Development, Accounting, etc.

- **Client-based Reports**: Track hours spent working for specific clients.


![alt text](reporting-screenshot.png)
- **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.

The output within Obsidian will render detailed information for each time segment, as shown in the first image.

## Example Report

Call command `Ctrl+P` select `Insert Time Tracking Summary`

The reporting capability allows generating summaries for specific time ranges and topics:

- **Streams Report**: A summary of all topics (e.g., Development, Accounting) over a selected period.

```
time-tracking-summary
"2024-11-01", "2024-11-30"
```
- **Clients Report**: A summary for individual topic over a given time range.
```
time-tracking-summary
"2024-11-01", "2024-11-30", clients
```
These examples help demonstrate how you can leverage the new tracking and reporting capabilities.
## How to Use
1. **Tag Configuration**
- Configure your tags, icons, and sub tags using YAML in the settings of the plugin.
- Example configuration can be found in the settings:
2. **Tag your records with one or more tags / sub tags**
3. **Inserting Time Tracking Summary**
- Use the newly added command to insert the time tracking summary snippet into a markdown file.
- This will generate a report for a given period, optionally filtered by a specific topic.
```yaml
# You can have as many 'sections' as you want to track different domains separately or in parallel
# Example secction / topic 1
# Example section / topic 1
streams:
name: "🌊 Streams"
items:
Expand Down Expand Up @@ -131,13 +76,33 @@ clients:
- topic: "Client B"
tag: "#tt_client_b"
subTags: []`
subTags: []
```

## Tracker Data in Dataview
Super Simple Time Tracker has a public API that can be used with [Dataview](https://blacksmithgu.github.io/obsidian-dataview/), specifically [DataviewJS](https://blacksmithgu.github.io/obsidian-dataview/api/intro/), which can be accessed using the following code:

```js
dv.app.plugins.plugins["simple-time-tracker"].api;
```

# 🙏 Acknowledgements
If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!
The following is a short example that uses DataviewJS to load all trackers in the vault and print the total duration of each tracker:

```js
// Get the time tracker plugin API instance
let api = dv.app.plugins.plugins["simple-time-tracker"].api;
[![Support me (if you want), via Patreon, Ko-fi or GitHub Sponsors](https://ellpeck.de/res/generalsupport-wide.png)](https://ellpeck.de/support)
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));
}
}
```
13 changes: 6 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"id": "simple-time-tracker",
"name": "Super Simple Time Tracker",
"version": "1.0.3",
"id": "tag-based-time-tracker",
"name": "Tag Based Time Tracker",
"version": "1.0.1",
"minAppVersion": "1.2.8",
"description": "Multi-purpose time trackers for your notes!",
"author": "Ellpeck",
"authorUrl": "https://ellpeck.de",
"fundingUrl": "https://ellpeck.de/support",
"description": "Tag based time tracker for your notes!",
"author": "Sergey Novikov",
"authorUrl": "https://github.com/serrnovik",
"isDesktopOnly": false
}
Binary file removed screenshot.png
Binary file not shown.

0 comments on commit 059b414

Please sign in to comment.