kleinerpirat / anki-tooltips Goto Github PK
View Code? Open in Web Editor NEWAdd tooltips to your Anki cards with Tippy.js
License: GNU Affero General Public License v3.0
Add tooltips to your Anki cards with Tippy.js
License: GNU Affero General Public License v3.0
/home/user/.local/share/Anki2/addons21/1840818335/qt/editor.py:44: MarkupResemblesLocatorWarning: The input looks more like a filename than markup. You may want to open this file and pass the filehandle into Beautiful Soup.
soup = BeautifulSoup(txt, "html.parser")
I can not enable it to show tooltips on the front. It will throw the Error below. Seems like it gets the wrong data type.
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.55 (01caec2a) Python 3.9.15 Qt 6.4.0 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-02-16 11:40:47
Caught exception:
Traceback (most recent call last):
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1840818335\gui\dialogs\model_settings.py", line 48, in accept
self.callback(
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1840818335\qt\models.py", line 33, in set_settings
update_model(mw.col.models.get(mid))
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1840818335\utils.py", line 78, in update_model
mw.col.models.update_dict(model)
File "anki.models", line 223, in update_dict
File "anki._backend_generated", line 883, in update_notetype_legacy
File "anki._backend", line 148, in _run_command
anki.errors.BackendError: JsonError { info: "invalid type: boolean false
, expected a string at line 1 column 349" }
This is my content in card:
Then I hope add a tip to the word "love" with this code:
function prompt{
$ESC = [char]27
"$ESC[46mPS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) $ESC[0m"
}
I check the other card in Anki Browser and then came back to this card and it looked like this
But your old version didn't have those problems
I'm in Version 2.1.60 (76d88073) to use your latest version of the add-on. Maybe related this post
The functionality of this plugin is very good. But your latest update broke almost all of my cards about html
As reported on the forum (https://forums.ankiweb.net/t/tippy-tooltips-official-support/11844/133), the reloading of Svelte components such as the toolbar or fields causes a crash:
Uncaught (in promise) TypeError: cleanup is not a function
at browser_editor.js:64505:13
at run (browser_editor.js:61762:12)
at Array.forEach (<anonymous>)
at run_all (browser_editor.js:61768:9)
at destroy_component (browser_editor.js:63416:7)
at Object.d (browser_editor.js:109016:9)
at Object.d (browser_editor.js:65379:24)
at destroy_component (browser_editor.js:63417:34)
at Object.d (browser_editor.js:109065:9)
at Object.d (browser_editor.js:89279:32)
Relevant code:
return () => {
for (const cleanup of cleanups) {
cleanup();
}
};
The way the API is written currently, one must provide a cleanup function, otherwise the App will crash. Also, it has to be synchronous (although most Svelte interactions require awaiting an element). I will try to improve this upstream, but for now need to fix this issue with somewhat verbose callbacks.
"Ctrl+T, ..." is used is used for insertig mathjax or latex blocks. Your shortcut Ctrl+T doesn't seem to block/override the built in ones. In the latest version (git commit d9f1e2264) and 2.1.55 the following happens:
Ctrl+T opens your tooltip window, but then I can't directly write words starting with T or M, typing the letter "t" is then transformed to "[latex][/latex]" and the cursor is in the middle of the latex block. I have to manually delete this. (Or did I really miss that you can now remap Anki default shortcuts?)
That's strange.
PS
I installed the latest add-on version from today (2023-02-16) in 2.1.54. Your add-on is the only active one.
At the moment the add-on seems to collapse all fields in my editor so that it's not useable.
I attached a screenshot showing two overlapping windows. The editor is on the top in the background, at the bottom is the window showing my add-ons installed:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.