-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anki plugin #189
anki plugin #189
Conversation
Hello and thanks for the PR. I got sick yesterday, so probably won't be able to review this for at least a few days, probably a week. But I see that your editor changed indentation level from 4 spaces to 2 (and it seems line limit of 80 characters and double quoutes enforcment) in files you edited. This adds a lot of noise to PR and inconsistent with rest of repo. Could you change settings of your editor (there should be an option to change them only for this project, so it won't affect your global setup) to use 4 spaces for indentation and don't format/prettify files you editred? |
i think most of the noise should be now away, i also added a config for my editor, idk if i should put it in the gitignore but i dont think it will bother anyone and if someone other also uses zed they will get the right indent ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the PR! I don't mind including .zed/settings.json. I left a couple of comments, please take a look
about the white background from the cards
That's fine. I'm sure if we try to overwrite styles anyway it will break some users decks or something, it's fine to leave styles from Anki
currently im using the dangerouslySetInnerHTML attribute to render the answer from anki, im not quite sure if this is the best solution for this case...
I was thinking about this, and maybe iframe
with srcdoc
will work better (so styles from Anki won't bleed into Anori), but that might be tricky to setup and fit into layout. So if you want you can give it a try and change code to use iframe, but if not - no problem
src/plugins/anki/anki-plugin.tsx
Outdated
mainScreen: MainScreen, | ||
mock: () => { | ||
return ( | ||
<MainScreen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, this will just show empty mock widget for users who don't have Anki/AnkiConnect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not quite there will be the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update mock to look like a real widget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it already uses the default set of anki, another set would be quite troublesome, since we don't know which set the user has any active cards in it ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you mean. What I initially meant is to make mock widget look like legit one, it doesn't need to be working per se or have real data. All values can (and should) be hardcoded, so it will work without Anko/AnkiConnect installed. You can create any example card to show there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay, since im currently rather busy, i will do it in the coming week
fixed most of the points and do the rest tomorrow |
so this should be anything except the hard and good button. is there a way to show a button only if the widget has the size 3? |
You can use Like this: https://github.com/OlegWock/anori/blob/master/src/plugins/math/math-plugin.tsx#L169 |
if the widget has now a width of 3 or 4 then all the buttons will be shown |
added the mock example |
Perfect, thanks |
adding the anki plugin (#155)
for this to work anki must be running and the anki connect plugin must be installed. else there will be an error message:
about the white background from the cards, anki sends the question and answers always as complete html with css so it would be quite troublesome to change this.
currently im using the
dangerouslySetInnerHTML
attribute to render the answer from anki, im not quite sure if this is the best solution for this case...