Skip to content

[FEATURE REQUEST] Add frontmatter filtering for decks #47

Description

@kaptcha0

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"
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions