Skip to content

Conversation

@wongandj
Copy link

@wongandj wongandj commented Oct 7, 2023

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.

Added function org-anki--links-to-cloze and corresponding controlling variable org-anki-clozify-links.
Edited org-anki--is-cloze and org-anki--org-to-html to change their behavior if org-anki-clozify-links is non-nil.
@eyeinsky
Copy link
Owner

eyeinsky commented Oct 9, 2023

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.

@wongandj wongandj changed the title Clozify Links Feature Clozify Regexps Feature Apr 28, 2024
@wongandj
Copy link
Author

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.

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

Successfully merging this pull request may close these issues.

2 participants