org-anki icon indicating copy to clipboard operation
org-anki copied to clipboard

Clozify Regexps Feature

Open brosasaki opened this issue 1 year ago • 2 comments

Re: #80

This adds the ability to turn org-links into cloze fields during the sync process. Links to the same address share the same cloze field number, with the reasoning that links to the same place would be spoilers for each other. This is more true to the "why" section of the README, as it makes files more usable as normal org-mode files as well as Anki notes.

Possible ways to extend this functionality include exposing a hook for string-filtering functions (including some shared index of cloze field numbers per each sync process?) or adding options to filter other features, such as /emphasized/ or underlined text. The conversion of subheadings into cloze fields is also an option.

brosasaki avatar Oct 07 '23 04:10 brosasaki

I'm thinking this were even more flexible if the org-anki--org-to-html would be made into a customizable variable which people could override? This way there wouldn't need to be additional function for every $something -> Cloze conversion (in this case, links) -- that way one could write a custom function that converted bold text, code or anything else to Cloze by simply customizing that function.

eyeinsky avatar Oct 09 '23 13:10 eyeinsky

I've implemented your ideas as the customization option org-anki-auto-cloze-rules which gives a user-friendly way of customizing the auto-cloze functionality. It seems to work here, but give it a try on your system and if it works, it's ready.

brosasaki avatar Apr 28 '24 18:04 brosasaki