Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Add frontmatter filtering for decks #47

Open
kaptcha0 opened this issue Jan 18, 2025 · 0 comments
Open

[FEATURE REQUEST] Add frontmatter filtering for decks #47

kaptcha0 opened this issue Jan 18, 2025 · 0 comments

Comments

@kaptcha0
Copy link

I know you can filter a file by tags when creating decks, but I was hoping this feature would be more flexible. The current way to filter is as follows:

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

I was hoping that instead of the path just being $.tags, we can have access to all the frontmatter via a $.frontmatter.[whatever_frontmatter_goes_here] or just $.[whatever_frontmatter_goes_here].

In my case, I want to sort files into decks via a "decks" property, which is a list of links to the deck files. Here is my proposal:

# card1
tags: flashcard
decks:
  - deck1
  - deck2
# deck1
```aosr-deck-config
{
	"rule": {
		"conditions": {
			"all": [{
				"fact": "file",
				"path": "$.frontmatter.decks",
				"operator": "contains",
				"value": "deck1"
			}]
		},
		"event": {
			"type": "match"
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant