Bulk Cloze Selected List Items
Anki add-on for converting selected editor lines into cloze deletions.
Install from AnkiWeb: https://ankiweb.net/shared/info/702500540
Install
- Copy this folder into Anki's
addons21 directory, or symlink it there.
- Restart Anki.
- Open the Add window or Browser editor.
Anki 2.1.26 or newer is expected.
When installed locally, Anki should display the add-on as
Bulk Cloze Selected List Items.
Usage
Select multiple lines inside an editor field, then click the Bulk Cloze toolbar
button.
Example selected text:
apple
banana
strawberry
Becomes:
{{c1::apple}}
{{c1::banana}}
{{c1::strawberry}}
By default, all selected lines share the same cloze number.
Blank lines are skipped. Common bullet prefixes are stripped, including - ,
* , • , and numbered prefixes like 1. .
If the current note already contains clozes, the add-on uses the next cloze
number. For example, if the note already contains {{c1::sample text}}, the
selected list items become {{c2::...}}.
Use the 1+ toolbar button to toggle per-line numbering while editing. When
per-line numbering is enabled, this selected text:
apple
banana
strawberry
becomes:
{{c1::apple}}
{{c2::banana}}
{{c3::strawberry}}
If the note already contains {{c1::sample text}}, the same selected list starts
at c2 and becomes c2, c3, c4.
Test
- Create or edit a cloze note.
- Paste several lines into one field.
- Select those lines.
- Use the toolbar button.
- Confirm each nonblank line is wrapped as
{{c1::text}}.
- Try the action with no selected text and confirm Anki shows a tooltip asking
you to select list items first.
- Add
{{c1::sample text}} earlier in the same field, then select a plain list
below it and confirm the list items are wrapped as {{c2::text}}.
- Click the
1+ toggle, select a plain list, and confirm the cloze numbers
increment per selected line.
Configuration
The add-on exposes these config values:
{
"cloze_number": 1,
"increment_per_line": false
}
cloze_number is the minimum/default cloze number. Existing clozes in the
current note still take precedence when the add-on chooses the next
number.
increment_per_line controls whether each selected line gets the same cloze
number or increasing cloze numbers. The 1+ editor toggle updates this setting
without opening the add-on config page.