You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Concepts.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ This plugin was designed to read code blocks in [YAML format](https://en.wikiped
6
6
7
7
### Collecting Data
8
8
9
-
Providing parameters `searchType` and `searchTarget` is the minimum requirement for a successful data collection. `searchType` can be `tag`, `frontmatter`, `wiki`, `dvField`, `table`, `fileMeta`, `task`, or `text`. Then the cooresponding `searchTarget` should be provided according to the specified type.
9
+
Providing parameters `searchType` and `searchTarget` is the minimum requirement for a successful data collection. `searchType` can be `tag`, `frontmatter`, `frontmatterlist`, `wiki`, `dvField`, `table`, `fileMeta`, `task`, or `text`. Then the cooresponding `searchTarget` should be provided according to the specified type.
10
10
11
11
### Target Evaluation
12
12
13
-
Depends on the `searchType` and the `searchTarget` you provided, the evaluation of a target would be different. Simply speaking, you can track the occurrences of a target or the value attached/embedded in it.
13
+
Depending on the `searchType` and the `searchTarget` you provided, the evaluation of a target would be different. Simply speaking, you can track the occurrences of a target or the value attached/embedded in it.
14
14
15
15
To see the detail about the target evaluation, please check the document [Target Evaluation](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/TargetEvaluation.md).
Copy file name to clipboardExpand all lines: docs/TargetEvaluation.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Target Evaluation
2
2
3
-
From the [input parameters](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md) you provided, the search targets dispersed in the notes will be counted or evaluated as a value. Tracker plugin supports eight kinds of `searchType`: `tag`, `frontmatter`, `wiki`, `text`, `table`, `dvField`, `task`, and `fileMeta`, dealing with different types of searching condition.
3
+
From the [input parameters](https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md) you provided, the search targets dispersed in the notes will be counted or evaluated as a value. Tracker plugin supports nine kinds of `searchType`: `tag`, `frontmatter`, `frontmatterlist`, `wiki`, `text`, `table`, `dvField`, `task`, and `fileMeta`, dealing with different types of searching condition.
4
4
5
5
## Multiple Targets
6
6
You can provide multiple search targets in code block by entering an array of targets separated by a comma under parameter `searchType` and `searchTarget`. Each of the targets will be identified in order and then the values in notes will be evaluated and form a dataset indexed by that order in the array (zero-based indexing).
@@ -21,6 +21,8 @@ Many other parameters that accept multiple values (e.g. lineColor) can also be p
21
21
22
22
Multiple values under a target (value tuple) separated by a slash, e.g. #bloodpressure:180/120mmHg, are supported after version 1.3.0. To identify a specific value as a target, use an accessor with bracket notation where the value in the bracket is the index by the order of values. In this case, they are bloodpressure[0] and bloodpressure[1]. You can find the example of this [here](https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/BloodPressureTracker.md). You can also use a custom separator by using the parameter `separator`.
23
23
24
+
**Note**: the bracket notation used with searchType: frontmatterlist (e.g. habits[yoga]) uses the same bracket syntax but serves a different purpose. It specifies a string value to match against a list, rather than a numeric index into a tuple. The two are not interchangeable.
25
+
24
26
## Search Target in Detail
25
27
26
28
### searchType: tag
@@ -51,6 +53,42 @@ mood: 10<br>
51
53
......<br>
52
54
\-\-\-<br>
53
55
56
+
### searchType: frontmatterlist
57
+
This option is for vaultkeepers who want to use the same custom YAML property to track multiple targets. It is useful for tracking habits or categories recorded as a list in front matter fields *other* than tags.
58
+
59
+
This search type checks whether a specific value is present in a frontmatter key that holds a list. Ex:
60
+
```
61
+
habits: [habitA, habitB, habitC]
62
+
```
63
+
64
+
When specifying a searchTarget, use the key name followed by the member value in bracket notation:
65
+
```
66
+
searchType: frontmatterlist
67
+
searchTarget: habits[spanish]
68
+
```
69
+
When the member value is present in the list, it will be evaluated as a constant value (default 1.0). When it is absent, the day will have no value. This is ideal for counting occurances.
70
+
71
+
#### Formatting property values in frontmatter
72
+
73
+
Like tags, values stored in frontmatter lists are **case insensitive**. (ex: `piano` and `Piano` should be treated the same.)
74
+
75
+
**Single-line lists** can optionally be surrounded by square brackets, but it's not required. Any of the following will work in frontmatter and evaluate without issue:
76
+
-`habits: `
77
+
-`habits: []`
78
+
-`habits: spanish`
79
+
-`habits: [spanish]`
80
+
-`habits: yoga, spanish, piano`
81
+
-`habits: [yoga, spanish, piano]`
82
+
83
+
**Multi-line lists** are also allowed, ex:
84
+
```
85
+
habits:
86
+
- yoga
87
+
- spanish
88
+
- piano
89
+
```
90
+
91
+
54
92
### searchType: wiki
55
93
This search type helps you count wiki links in articles. For example,
Copy file name to clipboardExpand all lines: examples/TestFrontmatter.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ line:
36
36
```
37
37
38
38
## Multiple Tags in Front Matter
39
-
Extract data of one tag from multiple tags
39
+
Extract data of one tag from multiple tags.
40
40
The default separator in front matter tags is comma (,)
41
41
```tracker
42
42
searchType: tag
@@ -54,7 +54,7 @@ line:
54
54
pointBorderColor: "#d65d0e"
55
55
```
56
56
57
-
Use the data of two tags
57
+
Use the data of two tags.
58
58
The default separator in front matter tags is comma (,)
59
59
```tracker
60
60
searchType: tag
@@ -65,4 +65,7 @@ month:
65
65
initMonth: 2021-01
66
66
```
67
67
68
-
Please also check those search targets in markdown files under folder 'diary'.
68
+
Please also check those search targets in markdown files under folder 'diary'.
69
+
70
+
71
+
Note about multiple values: When extracting one value from a list of multiple values in frontmatter fields besides tags, please refer to TestFrontmatterList.md.
This option is helpful for vaultkeepers who want to track multiple habits (targets) using the same custom YAML property.
3
+
4
+
## Example outputs
5
+
Each of the outputs below is generated by searching frontmatter for `habits: ` , then checking the list of values for the presence of a single habit, ex: `yoga`, `piano`, or `spanish`.
6
+
7
+
```tracker
8
+
searchType: frontmatterlist
9
+
searchTarget: habits[yoga]
10
+
folder: diary
11
+
startDate: 2026-02-01
12
+
endDate: 2026-02-28
13
+
datasetName: Yoga
14
+
month:
15
+
```
16
+
17
+
18
+
19
+
```tracker
20
+
searchType: frontmatterlist
21
+
searchTarget: habits[spanish]
22
+
folder: diary
23
+
startDate: 2026-02-01
24
+
endDate: 2026-02-28
25
+
datasetName: Spanish
26
+
month:
27
+
color: orange
28
+
```
29
+
```tracker
30
+
searchType: frontmatterlist
31
+
searchTarget: habits[piano]
32
+
folder: diary
33
+
startDate: 2026-02-01
34
+
endDate: 2026-02-28
35
+
datasetName: Piano
36
+
month:
37
+
color: lightblue
38
+
```
39
+
40
+
```tracker
41
+
searchType: frontmatterlist
42
+
searchTarget: habits[piano]
43
+
folder: diary
44
+
startDate: 2026-02-01
45
+
endDate: 2026-02-28
46
+
summary:
47
+
template: "Total count: {{sum()}}"
48
+
```
49
+
50
+
51
+
52
+
### Testing
53
+
54
+
**Bracket test**: Single-line lists can be surrounded by square brackets, but it's not required. (Trailing commas won't break anything either.)
55
+
- 2/9: `habits: []`
56
+
- 2/10: `habits: [piano]`
57
+
- 2/12: `habits: [yoga, spanish]`
58
+
- 2/16: `habits: `
59
+
- 2/8: `habits: spanish`
60
+
- 2/15: `habits: yoga, spanish, piano`
61
+
62
+
.
63
+
64
+
**Case test**: Values stored in frontmatter lists are **case insensitive** for this plugin, mirroring the behavior of tags. In the examples above, `yoga` and `Yoga` should be treated the same.
65
+
66
+
If search targets are case insensitive, then both 2/14 and 2/17 will be highlighted on the `month:` output for `habit[yoga]` when the examples vault is viewed in Obsidian.
67
+
68
+
.
69
+
70
+
**Multi-line list test**: If multi-line lists are working, then 2/14 will be highlighted on each of the calendars above when the examples vault is viewed in Obsidian.
0 commit comments