generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a53a0d2
commit a2e1eca
Showing
2 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
# Target Evaluation | ||
If the assigned '**searchType**' is '**tag**', tags in your daily notes will be counted and evaluated. You should use the tag name (the name after #) as the value of key '**searchTarget**' or use quoted tag ('**#tagName**') to make it work. | ||
|
||
A simple tag is a tag in the format of '*#tagName*'. They will be evaluated as a constant value (default value 1.0). You can change the value by assigning the key '**constValue**' in the code block. | ||
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. | ||
|
||
The unique feature in the obsidian-tracker is to identify the value-attached tag. Users can attach a value after 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 use the provided value instead of the constant one. | ||
## tag | ||
|
||
Nested tags are also supported. One can use them to track parent-tag and children-tags separately. It's worth noting that frontmatter tags are also included but can only be treated as simple tags. Currently, Obsidian will treat tags with different values as different tags. | ||
Simple tags in the format of '*#tagName*' in the file content are evaluated as a constant value (default value 1.0). You can override the value by assigning the key '**constValue**' in the code block. Use the tag name (the name after #) as the value of key '**searchTarget**' or use quoted tag ('**#tagName**') to make it work. | ||
|
||
If the assigned '**searchType**' is '**text**', texts will be counted and simply evaluated by occurrence. | ||
For tags in frontmatter (e.g. tags: meditation), it works like simple tags and will be evaluated as a constant value. For example, | ||
``` | ||
tags: tagName1, tagName2 | ||
``` | ||
Set '**searchTarget**' to tagName1 or tagName2 do the 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. | ||
|
||
Nested tags with values attached could be useful for tracking children's data separately and also still see the overall merged data using parent tags. | ||
|
||
If you don't want value-attached tags in your content, you can use the '**frontmatter**' target. | ||
|
||
## frontmatter | ||
This search type is used to query the key-value pairs in the front matter. If you don't want these values been seen in your article, the front matter would be the best place to record. For example, | ||
``` | ||
mood: 10 | ||
``` | ||
|
||
## wiki | ||
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). |