Skip to content

Commit

Permalink
Update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrochlore committed Apr 19, 2021
1 parent a2e1eca commit 9a46bb4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Obsidian Tracker Plugin
![GitHub release](https://img.shields.io/github/v/release/pyrochlore/obsidian-tracker)

This is an [Obsidian](https://obsidian.md/) plugin that helps you do tracking in daily notes. You can track:
tags
track the number of occurrences of in-line tags (e.g. #meditation)
track the number of occurrences of front matter tags (e.g. tags: meditation)
track the value after a tag (e.g. #weight:60.5kg)
track the value after a nested inline tag (e.g. #finance/bank1/transfer:100000USD and the parent tag #finance/bank1)
front matter key-value pairs
track the value of a key in the front matter (e.g. mood: 10)
wiki links
track the number of occurrences of wiki links (e.g. [[journal]])
text
track the number of occurrences of texts (e.g. '⭐', 'love', or any text that matches your regex expression)
track the value embedded in texts using regular expression (e.g. walk 1000 steps, weightlifting: 50)

<img src="https://raw.githubusercontent.com/pyrochlore/obsidian-tracker/master/docs/images/Screenshot_v1.1.png" width="800">

This is an [Obsidian](https://obsidian.md/) plugin that helps you do tracking in daily notes. You can:
### tags
- track the number of occurrences of in-line tags (e.g. #meditation)
- track the number of occurrences of front matter tags (e.g. tags: meditation)
- track the values after tags (e.g. #weight:60.5kg)
- track the values after a nested inline tags (e.g. #finance/bank1/transfer:100000USD and the parent tag #finance/bank1)

### front matter key-value pairs
- track the values of a key in the front matter (e.g. mood: 10)

### wiki links
- track the number of occurrences of wiki links (e.g. [[journal]])

### text
- track the number of occurrences of texts (e.g. '⭐', 'love', or any text that matches your [regex expression](https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/TrackWithRegex.md))
- track the values embedded in texts using regular expression (e.g. walk 1000 steps, weightlifting: 50)

## Installation
### Install from Obsidian Settings Panel
1. From Settings Panel (the icon at the bottom left corner) -> Options -> Community plugins, set 'safe mode' to off.
Expand All @@ -29,7 +32,7 @@ track the value embedded in texts using regular expression (e.g. walk 1000 steps
Download the latest [release](https://github.com/pyrochlore/obsidian-tracker/releases). Extract and put the three files (main.js, manifest.json, styles.css) to folder '{{obsidian_vault}}/.obsidian/plugins/obsidian-tracker'.

## Usage
1. Have some tags or texts you want to track in daily notes. Take a look at [Target Evaluation](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TargetEvaluation.md) for what you can track and how targets are evaluated as numbers.
1. Have some targets you want to track in daily notes. Take a look at [Target Evaluation](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TargetEvaluation.md) for what you can track and how targets are evaluated as numbers.
2. Add a new note for displaying the tracker.
3. Add tracker code blocks manually or using commands. See [Commands](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/Commands.md) for more detail.
4. Switch the document view mode to 'Preview', then the code block will get rendered.
Expand All @@ -47,12 +50,12 @@ This plugin was designed to read code blocks in [YAML format](https://en.wikiped
Providing key '**searchType**' and '**searchTarget**' is the minimum requirement for a successful data collection and rendering. The value of key '**searchType**' can be '**tag**', '**frontmatter**', '**wiki**', or '**text**', and the cooresponding '**searchTarget**' is the name of a tag or a piece of text as your search target.

### Target Evaluation
Depends on the searchType and the format of your targets, the target evaluation would be different. You can simply track the occurrences of a target or track value attached or embedded in it.
Depends on the searchType and the format of your targets, the target evaluation would be different. You can simply track the occurrences of a target or track value attached/embedded in it.

For more information about the tag evaluation, please check documents for [Target Evaluation](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TargetEvaluation.md)

### Rendering Output
Currently, obsidian-tracker provides two kinds of rendering output, the default one 'line' for line chart and 'summary' for text description.
Currently, obsidian-tracker provides two kinds of rendering output, the default one 'line' for line chart and 'summary' for a text description.

For 'line' output, the plugin will generate a customizable line chart. For 'summary' output, you can use [pre-defined template variables](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TemplateVariables.md) in text template (key '**template**' under key '**summary**').

Expand All @@ -65,8 +68,8 @@ Plugin settings 'default folder' and 'default date format, are removed in versio
## Release Notes
### v1.2.0
- Enable using regular expression in text searching.
- New search type 'frontmatter', searching numerical key-value pair in the front matter.
- New search type 'wiki'.
- New search type 'frontmatter', searching for key-value pair in the front matter.
- New search type 'wiki', searching for wiki links.
- Reduce package size.

### v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion docs/Commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commands
To smooth the process of making trackers, we provide two commands, "Add Line Chart Tracker" and "Add Summary Tracker; Type Ctrl/Cmd+P to activate the command palette, then type "Tracker" to search it.

After a command is selected, a code block will be added to the next line below your cursor. The added code block will contain the most frequently used keys. To see the complete list of input parameters and explanations, check [this document](InputParameters.md).
After a command is selected, a code block will be added to the next line below your cursor. The added code block will contain the most frequently used keys. To see the complete list of input parameters and explanations, check [this document](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md).

Now replace the fields for your case and start tracking.
4 changes: 2 additions & 2 deletions docs/InputParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ These key-value pairs are placed under the YAML root. They were used for collect
| Key | Default | Description |
|:--------:|:-------:|:-----------:|
| **searchType** | Empty string | The type of searchTarget |
| **searchTarget** | Empty string | [The target to search](TargetEvaluation.md) |
| **searchTarget** | Empty string | [The target to search](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TargetEvaluation.md) |
| **folder** | Root of this vault | The folder path of your daily notes |
| **dateFormat** | "YYYY-MM-DD" | The date format of your daily note title |
| **startDate** | Min date found | The start date for collecting data |
Expand Down Expand Up @@ -47,5 +47,5 @@ These key-value pairs should be placed under the key '**line**'.
## Summary Related Parameters
These key-value pairs should be placed under the key '**summary**'.

| **template** | Empty string | Text template (May include [template variables](TemplateVariables.md)) |
| **template** | Empty string | Text template (you may embed [template variables](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TemplateVariables.md) |
| **style** | Empty string | css style for the rendered text block |
6 changes: 3 additions & 3 deletions docs/TargetEvaluation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Target Evaluation

According to the [input parameters](InputParameters.md), the provided search target will be counted or evaluated as a value. Obsidian-tracker supports four kinds of searchType: 'tag', 'frontmatter', 'wiki', and 'text', dealing with different types of searching condition.
According to the [input parameters](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md), the provided search target will be counted or evaluated as a value. Obsidian-tracker supports four kinds of searchType: 'tag', 'frontmatter', 'wiki', and 'text', dealing with different types of searching condition.

## tag

Expand All @@ -10,7 +10,7 @@ For tags in frontmatter (e.g. tags: meditation), it works like simple tags and w
```
tags: tagName1, tagName2
```
Set '**searchTarget**' to tagName1 or tagName2 do the work.
Set '**searchTarget**' to tagName1 or tagName2 will make the plugin do his work.

In your content, a value can be attached to the tag in the format of '*#tagName:value*'. Note the value should be appended right after your tag and an extra colon without spaces. If a value is attached this way, the obsidian-tracker will automatically use the provided value instead of the constant one.

Expand All @@ -28,4 +28,4 @@ mood: 10
This search type helps you count wiki links in articles.

## text
searchType 'text' is the most powerful one among all. If you simply provide text like 'love', the number of occurrences of tags will be counted. You can provide a regular expression to search for a very complicated target by wrapping it in single quotes. If you want to retrieve a value from it, use the group name in the expression. To see more detail, see [this case](TrackWithRegex.md).
searchType 'text' is the most powerful one among all. If you simply provide text like 'love', the number of occurrences of tags will be counted. You can provide a regular expression to search for a very complicated target by wrapping it in single quotes. If you want to retrieve a value from it, use the group name in the expression. To see more detail, see [this case](https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/TrackWithRegex.md).
4 changes: 2 additions & 2 deletions docs/TemplateVariables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Template Variables in Summary
# Template Variables

When you choose 'summary' as the output type (by placing a key 'summary'), you can embed template variables into the value of the 'template' key. In this manner, the plugin will do calculations according to the collected dataset, and render the output with variables replaced by calculated results.

Expand All @@ -18,4 +18,4 @@ Here are all the predefined template variables available for now.
| {{median}} | Median value |
| {{variance}} | Variance value |

Notice when doing calculations like sum or average, the missing values are ignored. You can set those missing values to zero by setting the value of key 'penalty' to zero. Moreover, if the key 'ignoreZeroValue' is assigned true, zero value will be ignored too. You can check these parameters [here](InputParameters.md)
Notice when doing calculations like sum or average, the missing values are ignored. You can set those missing values to zero by setting the value of key 'penalty' to zero. Moreover, if the key 'ignoreZeroValue' is assigned true, zero value will be ignored too. You can check these parameters [here](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md)

0 comments on commit 9a46bb4

Please sign in to comment.