From db2f2dbec1a68bf07ca7f12a309242a10a3f4a12 Mon Sep 17 00:00:00 2001 From: linanwx Date: Sat, 29 Jul 2023 14:42:18 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 38a4968..b64190e 100644 --- a/README.md +++ b/README.md @@ -315,6 +315,26 @@ Here are some examples of how you can define rules for your decks: } ``` ````` +4. **Filtering Fiels 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: From 6f21d47981634e38f88d2317b249ada036e699f0 Mon Sep 17 00:00:00 2001 From: linanwx Date: Sat, 29 Jul 2023 14:42:55 +0800 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b64190e..d4f1cd0 100644 --- a/README.md +++ b/README.md @@ -315,7 +315,7 @@ Here are some examples of how you can define rules for your decks: } ``` ````` -4. **Filtering Fiels with a Specific Tag in Frontmatter:** +4. **Filtering Files with a Specific Tag in Frontmatter:** `````` ```aosr-deck-config From 5212d654b0a6591f14a7164af513521e6bac575a Mon Sep 17 00:00:00 2001 From: linanwx Date: Sat, 29 Jul 2023 15:27:45 +0800 Subject: [PATCH 3/4] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d4f1cd0..e6eef08 100644 --- a/README.md +++ b/README.md @@ -345,6 +345,9 @@ interface FactPattern { tags: string[] text: string } + file: { + tags: string[] // from frontmatter + } } ``` From e9862732b275a38ed618711d5504b882214c88f0 Mon Sep 17 00:00:00 2001 From: linanwx Date: Sat, 29 Jul 2023 15:28:24 +0800 Subject: [PATCH 4/4] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6eef08..62d4165 100644 --- a/README.md +++ b/README.md @@ -345,9 +345,9 @@ interface FactPattern { tags: string[] text: string } - file: { - tags: string[] // from frontmatter - } + file: { + tags: string[] // from frontmatter + } } ```