Skip to content
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

Interested in some new features #2

Open
thiswillbeyourgithub opened this issue Aug 2, 2020 · 6 comments
Open

Interested in some new features #2

thiswillbeyourgithub opened this issue Aug 2, 2020 · 6 comments

Comments

@thiswillbeyourgithub
Copy link

thiswillbeyourgithub commented Aug 2, 2020

Hi,

I just discovered your addon thanks to ijgnd on the new anki forum. It's wonderful and something that highly interests me.

As you can see from the link above, I sort of have a dream list of what I'd like to see in terms of cloze manipulation. I was wondering if you were interested in adding these features OR if I could hire your services to do so.

Here's a rough list of my wild dreams :

  1. A shortcut to increment or decrement the cloze I'm in OR the last added cloze if the cursor is not already inside a cloze.

  2. Shortcut that when pressed once takes you to the inner end of the last entered cloze, twice for inner beginning, thrice for outer end. A bit like what you have made already but I prefer repeating a shortcut than having to think of which modifiers to press.

  3. A way for my cursor to automatically "jump" the {{c[0-9]:: and }}. The cursor never needs to be between the } so it's just slowing me down when I have to go to the other end of the line. Especially if I can increment or decrement using a quick shortcut.

Probably some other stuff too but I don't remember them off the top of my head.

Is it something that interests you? I can code but it's more of a hobby and would take AGES for me. If you want to get paid for this please give me an idea of the amount and delay. I'm a non-poor student but would gladly help the FOSS ecosystem this way. But I must say that, frankly, I have no idea if it's closer to $6 or $600.

Thanks for reading this. Have a nice day and thanks again for this addon!

edit : to clarify I use clozes HEAVILY, because I rely on my own template that you can see here https://github.com/thiswillbeyourgithub/Clozolkor It makes very messy clozes but very effective learning!

@epiphanie-gedeon
Copy link
Contributor

Hi!
Apologies for the delay in my reply, I wanted to test some things before answering to be sure I had the right understanding.

Thank you very much for your question and suggestions of improvement. Let me reply to each of them:

  • 1 is very easy. My add-on is made to be very generic, so it's just a matter of a simple js function to implement. I will do it right now

  • 2 is a little trickier. Supposedly, this is exactly what Qt's ambiguous shortcut should cover, but I still haven't been able to get them to work. I could always use a timer/enable them programmatically, but this feel a little clunky. I should dig into it more (if anyone has an idea on why onActivatedAmbiguously does not trigger with two shortcut, I would be interested)

  • As for 3, I am unsure how that would work. I would either need to tweak the code of the editor to monitor the movement of the cursor, or replace {{c[0-9]:: with images when displayed? I do not yet know how that would work, so if you have something clearer in mind, that would be helpful!

As for payment, I would not ask payments for such little modifications/maintenance (I do accept tips at the paypal [email protected] but they are not mandatory at all)
Anki is not my priority however (I do not use it much), so if you want something that is very big/worthy of an entirely different addon, I might ask for it (as for reference, I usually ask for $50 for an addon, along with generality and maintenance).

I would be very interested to hear about the other features you would like added in, please feel free to list them as well ^^ !

@thiswillbeyourgithub
Copy link
Author

thiswillbeyourgithub commented Aug 10, 2020

Hi!

Sorry for not answering earlier. Thanks a lot for your thorough answer.

  1. Thanks a lot! Eager to see that

  2. I have not learned pyqt yet so I can't help.

  3. Yeah, to be honest and on second thought I think it should rather be done on anki's side. It should be done at the addon level I mean.

Additionnally : could your addon do something like symbols as you type? I use it a lot to format my clozes quicker but it seems somewhat limited for this, especially because you can't specify the cursor position after pasting. You can have an idea of what I mean here

I am also very interested to add some sort of vim-like keybindings to anki, as I despise typing anywhere else than vim, but unfortunately have to type quite a lot in anki. It seemed impossible to do until recently when I stumbled upon FakeVim. Which seems to be exactly what I need but from what I understand it's Qt and not pyQt. Do you have any idea of the feasability of adding this to anki? From what I gather it seems quite doable but it's way outside my current skills to even be sure.

I will certainly remember to ask you if I'm in need of this kind of service. Thanks!

Have a nice day!

@epiphanie-gedeon
Copy link
Contributor

epiphanie-gedeon commented Aug 12, 2020

Actually, for 1, should it remember the last added cloze even if the cursor moves? I ask because the add-on primarily works with cursor position right now (it infers the current cloze based on its position). So I could either detect }} <cursor> as well, but that wouldn't work after movement. I'd need to tweak anki's code through the add-on for that.
Does that mean that every function should be able to work on the last added cloze if no match is found?

could your addon do something like symbols as you type?

Do you mean like ::f::, \frac{<cursor>}{}? I feel like this would be better off as a PR to insert-anki-addon, I'll see what I can do.

I am also very interested to add some sort of vim-like keybindings to anki

FakeVim actually does have an interface with PyQt. The main problem is that you can't really add dependencies with addons without embedding them, and it seems to use Cython (not yet sure of that). I'll have to check to see if it's embeddable properly or modifiable to have a Cython-free version.

Thanks a lot for your suggestions!

@thiswillbeyourgithub
Copy link
Author

thiswillbeyourgithub commented Aug 12, 2020

Does that mean that every function should be able to work on the last added cloze if no match is found?

I think so. If the user triggers the function, then he must be speaking about the last/closest cloze. Maybe "closest" would be easier to code and is equally intuitive. Hence : I think it's expected behavior.

Also, is it planned to work when a text area is selected ? If triggered : find the clozes inside and increment them. It's especially useful for list clozes like I use a lot.

Do you mean like ::f::, \frac{}{}? I feel like this would be better off as a PR to insert-anki-addon, I'll see what I can do.

That would be awesome! Thanks a bunch!

FakeVim actually does have an interface with PyQt. The main problem is that you can't really add dependencies with addons without embedding them, and it seems to use Cython (not yet sure of that). I'll have to check to see if it's embeddable properly or modifiable to have a Cython-free version.

I'm on the edge of my seat for the record.

I'm tipping you today! Thanks a lot!

@thiswillbeyourgithub
Copy link
Author

Hi,

Have you had, by any chance, the time to look at the feasibility of implementing vim like bindings in Anki ?

Have a nice day!

@thiswillbeyourgithub
Copy link
Author

Hi,

Is https://github.com/ankidroid/Anki-Android/issues/4709#issuecomment-707178629 something you would be interested in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants