Code Monkey home page Code Monkey logo

Comments (20)

Stvad avatar Stvad commented on September 24, 2024 1

Hey @ohare93! Sounds good! Looking forward to your contribution! Please add here what approach you're planning to take so we'd be on one page for it.

Re contribution document - it sounds like a good idea to have one :). I'll look into creating one over the weekend.

To get you started though:

  1. Checkout repo
  2. run package_plugin.sh
  3. Remove the production version of the plugin from Anki
  4. Add a symlink to the Anki plugins folder pointing to crowd_anki directory

At this point if you start Anki - it'd be using your development version of CrowdAnki. To test new changes you've made - you need to restart Anki.

If you want to add new library dependency - add them to the Pipfile and re-run package_plugin.sh

Unit tests:

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024 1

Alright, I'll pick this back up in a few weeks time πŸ‘ saying it here to commit myself πŸ˜…

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024 1

@ukanuk

A third potential implementation method (could be in addition to methods 1 & 2 above):

  1. An import dialogue where users manually select which fields should overwrite their personal collection

Giving users this override option is definitely the plan πŸ‘ But I do believe that the setting of personal fields by deck creators is a necessity for this feature to function properly, otherwise users must correctly select the personal fields each time. Do it wrong once and don't notice right away and you lose all your personal information! 😱

So it's useful to be able to overwrite some set of default values, but also to be able to skip overwriting any fields which users may otherwise want to customize.

An already working feature in my current shitty test implementation is for a field to be marked personal, but also to have a value. What that would do is that it takes the value for new cards and does not take the value (i.e. keeps it personal) for existing cards. That would achieve what you want, but I agree there are other scenarios not covered by this that the personal user option may cover.

If an import dialogue were created, it would additionally be awesome to have a checkbox for whether card templates are overwritten, and for whether the options/configuration group is overwritten (as would be desirable per #61 and #31)

Cannot agree more πŸ‘

I'll see how far I can push this functionality into an actual feature this weekend. I'll update my PR regardless, so others can play with if they like πŸ‘

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024 1

Fyi for anyone interested, I have been linked to the Special Fields add-on, which implements the same general feature I am trying to accomplish with this PR in CrowdAnki. You mark fields so that their value will not be overwritten.

However it is rather limited πŸ˜“ As you can see in this video (12 mins in) there is no gui, and one must edit the protected fields in the code of the add-on each time a different set of fields need be protected 😞

It is heartening to see that others are trying to accomplish the same goals, and that people are using the Special Fields add-on with enthusiasm 😁 as my current implementation in #72 is much more user friendly with a proper gui, I am certain that people will use this feature πŸ‘

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

I feel like taking a crack at this issue myself, due to this being a major blocker for some of my other goals. As such I have forked this repo, and intended to have a look into this.

However I am a bit confused by the repos intended workflow. Where do your sync the folder to locally? I see the Anki-Addon files are in the crowd-anki folder, but do you store this in the addons folder og anki? I thought the top level folder must have an init.py to be recognised. If you don't store it there, how do you sync changes you make? Also, must I uninstall the production version of CrowdAnki first?

A contribution document would be helpful. Have I overlooked something like this? Thanks πŸ‘

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

Ah, Linux! My mortal enemy πŸ˜… well I have been meaning to get round to making a Linux VM, perhaps this will be the thing that kicks me into gear. Thank you though, this was very useful πŸ‘

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

You don't actually need Linux for this. I presume you use Windows? In that case you only need to install Pipenv and Bash for Windows (the latter is optional, but makes things easier)

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

Created https://github.com/Stvad/CrowdAnki/blob/master/CONTRIBUTING.md let me know if you I think I should add something else there/explain something in more details

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

Hey mate, sorry for the delay, been busy.

You should mention in your CONTRIBUTING.md that you need to make a symlink to a folder in the add-ons folder which is not named "crowd_anki" πŸ˜“ this simple error on my part (as I just named the symlink the same as the original folder) caused countless wasted hours, and the add-on would do nothing (but it loaded and was in the add-on list), as the first line in __init__.py checking if tests are running:

if __name__ != "crowd_anki":

So anyways since I got past that hiccup, I am now getting some requirement errors. Specifically for a module named multiprocessing not existing.

image

I have ran pipenv install --dev and fetch_dependencies.sh many times with no errors. Any help?

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

You should mention in your CONTRIBUTING.md that you need to make a symlink to a folder in the add-ons folder which is not named "crowd_anki"

Ouch. I wonder how I never hit that one. Sorry about that, updated the CONTRIBUTING

multiprocessing is a part of standard library so it should be present πŸ€”. I remember hitting a problem when some other standard modules were not included in the Anki's distribution of Python (very annoying). I suspect it can be the case here with Anki packaging a custom distribution of Python for Win.

I thought things improved on this front (didn't hit any of those since migrating to 2.1). It's an avenue for investigation, I'll look more into it on the weekends.

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

https://apps.ankiweb.net/docs/addons.html#standard-modules this πŸ‘Ώ

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

Wait, the prod version of CrowdAnki works for you, right?

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

Oh, I should have mentioned: due to this project and a few others requiring a lot of requirements that were a big hassle to setup on my Windows machine I have created a Linux dual boot (specifically Kubuntu 18.04). So all of this work and future work will be done in there.

Wait, the prod version of CrowdAnki works for you, right?

Yes of co-... No... It does not! πŸ€” strange, I never even considered that, as I've not installed any prod versions of add-ons on this development machine. So there is something missing on my machine? πŸ€” I have Python installed (2.7 and 3.6) and running import multiprocessing in the command line works fine for each of them πŸ˜–

Will keep trying to fix, but any help would be greatly appreciated!

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

I see. I haven't heard Linux people complaining about this. So I wonder what's happening here πŸ€”

Did you install your anki instance using the system's package manager (i.e. something like apt-get install anki ) or by downloading it from anki website? If you went with the second option - can you try the first one?

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

Hey, that fixed it! Installing with sudo apt-get install anki then a quick sudo apt-get install python3-distutils fixed my issues. Thank you πŸ‘ Now I can actually program πŸ˜…

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

πŸŽ‰

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

If you have those images in github repo won't that still be considered personal use? I.e. you're not charging money for access or anything like that

from crowdanki.

ohare93 avatar ohare93 commented on September 24, 2024

Good question, I am not an expert in this, however I believe it is still an issue. I would still sharing those images to others, especially if I wanted to upload the deck to AnkiWeb 😨 When sharing on AnkiWeb you have to tick a box which states:

Copyright
I declare under penalty of perjury that the material I am sharing is entirely my own work, or I have obtained a license from the intellectual property holder(s) to share it here.

πŸ€”

from crowdanki.

Stvad avatar Stvad commented on September 24, 2024

Scary πŸ˜›

from crowdanki.

ukanuk avatar ukanuk commented on September 24, 2024

This feature would be useful in a number of different ways, not just stopping the sharing of copyrighted images. In the Ultimate Geography deck, for instance, there could be a field "Personal Notes" with the users own memory or personal helpful tip on that country. Everyone surely has these personal thoughts which could aid them in recall, but in a shared deck like this it is impossible to add in your own, without the risk of losing them when you next upgrade. With this feature, no longer will you be stuck deciding one or the other!

+1000! I have a kanji learning deck that I would to convert to shared GitHub deck, but it also has several fields for personal thoughts/notes that shouldn't be imported or overwritten!

A third potential implementation method (could be in addition to methods 1 & 2 above):
3. An import dialogue where users manually select which fields should overwrite their personal collection (the note model and/or card skip flags could still be used, where note model would set the default for which fields are/aren't imported, but users have checkboxes to overwrite this if they want to change what's imported one time).

Having the import easily configurable like this would be valuable to me for my kanji deck, because I have a "kanji meaning" field which should be initialized to default values when users first install the deck, but should be able to be changed by users afterwards without fear of getting overwritten. Using a one-word meaning to learn kanji is widely accepted even though kanji all have multiple meanings, but not everyone agrees on what that one word ought to be. So it's useful to be able to overwrite some set of default values, but also to be able to skip overwriting any fields which users may otherwise want to customize.

If an import dialogue were created, it would additionally be awesome to have a checkbox for whether card templates are overwritten, and for whether the options/configuration group is overwritten (as would be desirable per #61 and #31)

from crowdanki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.