diff --git a/README.md b/README.md index 648e87e..16573cb 100644 --- a/README.md +++ b/README.md @@ -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) - +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. @@ -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. @@ -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**'). @@ -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 diff --git a/docs/Commands.md b/docs/Commands.md index 1233de7..3b61378 100644 --- a/docs/Commands.md +++ b/docs/Commands.md @@ -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. \ No newline at end of file diff --git a/docs/InputParameters.md b/docs/InputParameters.md index 82832e0..0be7acd 100644 --- a/docs/InputParameters.md +++ b/docs/InputParameters.md @@ -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 | @@ -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 | \ No newline at end of file diff --git a/docs/TargetEvaluation.md b/docs/TargetEvaluation.md index a2f50bd..10b06ef 100644 --- a/docs/TargetEvaluation.md +++ b/docs/TargetEvaluation.md @@ -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 @@ -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. @@ -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). \ No newline at end of file +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). \ No newline at end of file diff --git a/docs/TemplateVariables.md b/docs/TemplateVariables.md index d2bcb8f..b6a6970 100644 --- a/docs/TemplateVariables.md +++ b/docs/TemplateVariables.md @@ -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. @@ -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) \ No newline at end of file +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) \ No newline at end of file