-
Notifications
You must be signed in to change notification settings - Fork 135
Cloze Paragraph style
Pseudonium edited this page Apr 27, 2024
·
7 revisions
Regex line: ((?:.+\n)*(?:.*{.*)(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
- Create a file called
test.md
- Paste the following contents into the file:
The idea of {cloze paragraph style} is to be able to recognise any paragraphs that contain {cloze deletions}. The script should ignore paragraphs that have math formatting like $\frac{3}{4}$ but no actual cloze deletions. With {2:CurlyCloze} enabled, you can also use the {c1|easier cloze formatting}, but of course {{c3::Anki}}'s formatting is always an option.
- In the plugin settings, paste the Regex line into the 'Custom Regexps' field associated with 'Cloze'
- Ensure that the 'Regex' and 'CurlyCloze' options are checked
- Click the Anki icon on the ribbon to run the plugin
- Run the script, and check 'Config' to open up the config file:
- Navigate to the "Custom Regexps" section
- Change the line
Cloze =
to
Cloze = (.*{.*\n?)
- Also set
CurlyCloze = True
to have the above example work properly. - Save the config file
- Run the script on the file, with 'Regex' checked:
- You should see these cards in Anki:
Regex line: ((?:.+\n)*(?:.*==.*)(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
You can also use markdown highlights instead of curly braces in order to indicate cloze deletions - just use the above style, and also enable 'CurlyCloze - Highlights to Clozes'!