Skip to content

Commit

Permalink
Merge branch 'master' of github.com:linanwx/aosr
Browse files Browse the repository at this point in the history
  • Loading branch information
linanwx committed Jul 31, 2023
2 parents f3dc0a7 + e986273 commit a6ba6ba
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,26 @@ Here are some examples of how you can define rules for your decks:
}
```
`````
4. **Filtering Files with a Specific Tag in Frontmatter:**

``````
```aosr-deck-config
{
"rule": {
"conditions": {
"all": [{
"fact": "file",
"path": "$.tags",
"operator": "regexMatch",
"value": "mathematics"
}]
},
"event": {
"type": "match"
}
}
}
``````

These examples should suffice for most use cases. However, if you need more complex rules, such as including cards from a specific path that contain certain tags but not others, you may need to write more complex rules. For more information on writing rules, refer to the [json-rules-engine documentation](https://github.com/CacheControl/json-rules-engine). Also, you may need to refer to the fact of the pattern, which is defined as follows:

Expand All @@ -325,6 +345,9 @@ interface FactPattern {
tags: string[]
text: string
}
file: {
tags: string[] // from frontmatter
}
}
```

Expand Down

0 comments on commit a6ba6ba

Please sign in to comment.