Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
plasmabit committed Sep 3, 2023
2 parents 0ecf0f2 + 52c3d96 commit a9a9235
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,35 @@ This plugin uses moment.js. It's a time manipulation library that is already inc
- Option to change update interval.
- Option to use UTC timezone.

## Frontmatter
## Modified frontmatter key

<img src="https://github.com/DynamicPlayerSector/timethings/assets/65742767/661884e4-666b-4793-9a46-de12edb831ed" height="800">

- Have a key that records the time when you last modified a file.
- Supports nesting.
- Option to change the date format. Recommended: `YYYY-MM-DD[T]HH:mm:ss.SSSZ`.

### About custom frontmatter handling solution
## Edit duration frontmatter key

![Obsidian_M7cBoaBPIq](https://github.com/DynamicPlayerSector/timethings/assets/65742767/16649b3b-4e4c-4e5f-9eed-3a28c8d5d4ec)

- Track time spent editing a note
- Display editing duration of current note in the status bar

## About custom frontmatter handling solution

Custom frontmatter handling solution is disabled by default since Obsidian's straightforward frontmatter API is much more stable and robust. However, advanced users may enable it if they wish. Don't forget to regularly back up your vault.

#### Reasons to enable custom frontmatter handling solution
### Reasons to enable custom frontmatter handling solution

- It updates the value instantly
- It only touches one line, which means it never makes your cursor jump, or a message "A file has been modified" popup
- It doesn't reformat your frontmatter to fit any standard

#### Reasons to leave custom frontmatter handling solution disabled
### Reasons to leave custom frontmatter handling solution disabled

- Using custom frontmatter handling solution with a nested key may result in the wrong key being updated. This only happens if it comes before the needed key in the frontmatter and has a similar path. For example `x.y.z` will update `x.y.g.z` instead if it meets it first and if it has a value of a format specified in the settings.
- Using custom frontmatter handling solution works best with templates since it doesn't create a key for you if it doesn't already exist. Also it doesn't update null values or the values of the format different from the one specified in the settings.
- You are using nested keys in the Time Things settings. Using custom frontmatter handling solution with a nested key may result in the wrong key being updated. This only happens if it comes before the needed key in the frontmatter and has a similar path. For example `x.y.z` will update `x.y.g.z` instead if it meets it first and if it has a value of a format specified in the settings.
- You are not using templates populated with needed variables to create notes. Using custom frontmatter handling solution works best with templates since it doesn't create a key for you if it doesn't already exist. Also it doesn't update null values or the values of the format different from the one specified in the settings.

I may improve it further in the future, but for that I feel like I'd have to write a full-blown YAML parser from scratch. For now it covers my own wishes completely and even has some room for limited flexibility, so I will focus on other aspects of the plugin.

Expand All @@ -43,3 +50,4 @@ I may improve it further in the future, but for that I feel like I'd have to wri
- [ ] Ingore files with specified frontmatter keys (and their values)
- [ ] Pick a timezone for all things globally
- [ ] Pick a timezone for clock and frontmatter seperately
- [x] Track time spent editing a note

0 comments on commit a9a9235

Please sign in to comment.