I encountered the following issues when developing and introducing card templates based on single page applications:
I need to use the storage function to save relevant information about the card,
such as :
the user’s favorite records of field content
Global configuration related to card decks
If such a feature can be supported, combined with user interaction, Anki cards can accomplish many amazing functions.I want to implement a simple function library that can be directly used in templates. Like manipulating the current card data, changing field values, or changing the global configuration of the deck.
If Anki needs such a feature, I am willing to contribute this feature code to Anki and Ankidroid
If this feature cannot be provided, I hope it can be supported on the platforms of Ankidroid and iOS
Storage solutions like: local storage
(or [cookies, sessions] Maybe it can also be used)
Currently, I am trying to use the browser’s localStorage
On the PC side, including Windows and Mac
Not supported on some Android devices
IOS does not support it at all
Thank you for your feedback,
but it seems that the Anki persistence library does not meet my needs.
What I want to achieve is to save a global configuration related to a card deck,
For example, the unfolding status of a folding block in a card, or whether night mode is enabled. This configuration needs to remain consistent even after the user restarts Anki. The implementation solution on Android uses session storage, which should cause data to be cleared after the user restarts.
And each client’s implementation method is different, which can lead to confusion in persistence processing logic. I want to achieve it through an elegant solution.
Can an area be partitioned from Anki’s persistence space to store such data and provide an open API to manipulate such data?
Okay, thank you for your attention.
I am looking forward to the release of this feature.
If you need to develop this feature, I am very willing to join in
I would like that feature as well. It would be e.g. very useful for decks using hanzi-writer, since it would enable users of decks to change the leniency of the quizes and the size of the canvas so that they are fitting their needs. The deck xiehanzi is an example for a deck that has this problem
Demand here .
I just found out only AnkiDroid is (usually) supporting such a feature out of the box. In terms of note templates localStorage would be a huge improvement, as it would be possible to use only JS for creating templates with settings that are able to be saved.