I want to create a simple addon that lets you peek at your upcoming review queue:
from aqt import gui_hooks
from aqt import mw
from anki.cards import Card
from google.protobuf.json_format import MessageToDict
def peek_queue(card: Card):
sched = mw.col.sched.get_queued_cards(fetch_limit=10)
d = MessageToDict(sched)
note_ids = [card['card']['noteId'] for card in d['cards']]
upcoming = [mw.col.get_note(int(note_id))['field']
for note_id in note_ids]
gui_hooks.reviewer_did_show_question.append(peek_queue)
upcoming
is an array of whatever is in field
. I want to make this available to the card template so that it can be displayed however you want to code it. I’ve thought of adding JS to the template with the variable available as per the dev guide, but I thought it would be nicer to somehow edit the note before it’s displayed so that this information is accessible as a field, i.e., {{next_hint}}
or something. Is this possible?