reuseman / flashcards-obsidian

🎴 An Anki plugin for Obsidian.md
MIT License
872 stars 86 forks source link

Add distinctive highlight-based clozing #133

Open voctory opened 1 year ago

voctory commented 1 year ago

Based on #118 I've been using this plugin for months and this has been my biggest gripe up until now — I'm sure this change will help save countless hours of Clozing :)

bytewife commented 1 year ago

Hey @voctory

From my understanding, with these changes, the plugin will create multiple Anki cards if a given line has multiple clozes, right? Could you clarify further?

voctory commented 1 year ago

@ivyraine Exactly, on the condition that the multiple clozes are highlight clozes. More specific clozing (e.g. matching up {1:pairs} of {1:keywords}) to a single cloze is still possible through the curly bracket syntax

voctory commented 1 year ago

Some examples:

image

putzwasser commented 1 year ago

As this is a breaking change it shouldn't simply be merged into main.

Otherwise the decks of the users who used this plugin "as-is" would be a complete mess after this merge/update.

There should be at least a configuration setting for the plugin, giving the users the option to choose how multiple == clozes should be treated.

Another idea could be to add a specific tag for this, like #anki-multicloze and #anki/multicloze, which would tell the parser to treat each == cloze as individual cloze.

bytewife commented 1 year ago

@putzwasser is right, this is a breaking change. I'd like to +1 the configuration setting recommendation. @voctory could you add that?

putzwasser commented 1 year ago

The (additional?) #anki-multicloze solution would give users even more flexibility. Instead of deciding, which "format" they'd need/wanted to use they could just use the tag.

The tag could be an indicator to reverse the setting. So, if multiple distinct clozes is turned on #anki-multicloze would enable the user to simply use == instead of the (more tedious) {1:first} and {1:second} cloze. If multiple distinct clozes is turned off, anki-multicloze would make each == cloze into separate distinct clozes (==first== and ==second== cloze #anki-multicloze turning into {{1:first}} and {{2:second}} cloze anki card).