obsidian-repeat-plugin icon indicating copy to clipboard operation
obsidian-repeat-plugin copied to clipboard

[Feature Request] Decks or groups of Notes

Open Sriramgireesh opened this issue 1 year ago • 3 comments

I know this is a long shot but I was wondering whether, in the long-term, there could be some option to group notes for review into certain groups or "decks" like in Anki. This would be really useful for students studying multiple subjects as it would help focus on specific topics/subjects during revision.

Sriramgireesh avatar Mar 11 '23 06:03 Sriramgireesh

Actually, the query for this would be pretty easy to implement. The query that gets due notes is here: https://github.com/prncc/obsidian-repeat-plugin/blob/39dd90e980ab9f43b2c3ebbb7184c825c8e33247/src/repeat/queries.ts#L12

You could change dv?.pages() to dv?.pages('#some_topic'), where the argument to pages is just a DataView query documented here: https://blacksmithgu.github.io/obsidian-dataview/api/code-reference/#dvpagessource

I think the hardest part would be adding an UI element that lets you type in the restriction query. I decided to avoid component libraries and keep the plugin simple and self-contained.

Are you interested in taking a stab at this? Note also that the spaced repetition is exponential, so this plugin doesn't use Anki's algorithm. To do that, we'd need to support an "easiness factor" and other variables that I think add too much complexity.

prncc avatar Mar 11 '23 18:03 prncc

Given that I wanted something like this exact function I've written modification that enables this, which does not use any external libraries.

The way I've designed is that in settings there's a text area where you can write tags that can be comma separated and behave like an AND. Each line is a separate option that you can choose from in the repeat view using a drop down. It also remembers what the last option you chose is and the drop down isn't there if you have no tags entered into the field.

Current limitation is that you can only use tags and not any advanced queries but that also adds to the simplicity of things.

jjsandee avatar Nov 18 '23 15:11 jjsandee

Here's how I think the steps should be for someone implementing this feature:

  1. Implement a basic filter input. a. First, add a "Display note filter input" toggle in repeat-plugin's settings. b. Add a text input field to the repeat view that's shown when the above setting is on. c. Allow the user to input dataview queries into this field, which is then used to filter notes as outlined in my previous comment. You could type in anything that appears following FROM in dataview's query language, like #tag to get all notes for #tag (that are also repeat notes -- always true).

  2. Implement saving filters as "decks" a. Convert the basic filter input into an input with a dropdown option into which filters can be saved. b. Add a button or other mechanism (e.g., option in the dropdown) for saving filters. Filters that are new are saved as-is (without any name). When clicked, the filter is saved into an array in data.json, and it's also editable from settings (I am not 100% if this can be done easily, but a compromised version of this idea should be doable.)

That way, you can specify a deck with a well documented filter (https://blacksmithgu.github.io/obsidian-dataview/queries/structure/) while relying on Obsidian's pre-existing organization mechanisms instead of adding new ones.

prncc avatar Feb 01 '24 02:02 prncc