Skip to content

Instantly share code, notes, and snippets.

View Troyciv's full-sized avatar

Troyciv

View GitHub Profile
@Troyciv
Troyciv / wrap_in_square_brackets.py
Last active October 12, 2017 20:57 — forked from kelciour/basic-cloze-button.py
Anki addon that wraps word in square brackets, used with cloze_on_basic_note.html
# -*- coding: utf-8 -*-
from anki.hooks import addHook
from aqt.editor import Editor
def add_square_brackets(editor):
u"""Call js function to wrap text in the span."""
editor.web.eval(ur"""wrap('\[\[', '\]\]');""")