Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
535 stars 44 forks source link

GitHub integration #2

Open nicolas-raoul opened 8 years ago

nicolas-raoul commented 8 years ago

Export a deck to GitHub directly from Anki.

one deck = one GitHub repository. People want to fork one of your decks, not all of your decks.

After a pull request has been merged on GitHub, Anki detects that, and retrieve the changes automatically from GitHub (if detection is not feasible, at least retrieve the changes at the click of a button within Anki).

Stvad commented 8 years ago

I'm thinking more about an ability to install decks from Github, as a fist step. Then supporting updates (either AnkiHub style, or just pulling in the master at first). And then maybe being able to push to github, as It will require significantly more effort to do this one, as I see it.

CNG commented 7 years ago

I came here looking for existing work around Anki and Git before I resorted to exporting the plain text format of my decks for versioning in a single repository. I haven't tried the plugin yet (but will soon), but wanted to register my use case regarding the one deck=one repo thought.

I am trying to use Anki more, and thus have many scattered decks, most of which are not cohesive enough to warrant collaboration. Still, I prefer both versioning and sharing, even if I don't have the time yet to make it as useful as it could be. Thus, I intend to store all or most of my decks under a single repo. I am not sure if i can do that yet with this plugin, but I assume I can use the JSON repr manually at least.

My point is I understand one repo per deck is nice and easy, but the same argument could be made for many things. I have a dotfiles repo that contains dozens of scripts and functions that each could be useful to someone and no one would likely have a use for all of them in the way I do, but it does not seem reasonable for me to have dozens of repos to hold each unit. Further, as I continue to integrate more of my projects into my Github, the number of repos will only grow, leading me to favor one repo per subject area of my life.

Certainly some component of one of my repos could be pulled out into someone else's repo if desired, and I could easily pull their updates back into mine if desired. I understand this is less user friendly for those new to Git or less tech savvy but simply looking to collaborate on flashcards, but keeping open the possibility of pointing to a subdirectory within a repo might not be horribly more complicated?

Hopefully I will have more to contribute soon. Thanks for your work so far!

Stvad commented 7 years ago

@CNG Hey, sorry I did not reply to you earlier. One thing you might consider doing is building a deck Hierarchy e.g. having a deck that would represent some topic of your life and having relevant subdecks under it. This way you can export the top deck and all subdecks would be exported as a part of it. Which will give you what you want and preserve one deck - one repo semantics at the same time.

CNG commented 7 years ago

Hi @Stvad, thanks for the reply. That is essentially my approach lately, though I have been exporting subdecks that are themselves umbrellas for more subdecks. My basic conflict is I want to have one repo (@CNG/anki-decks) to track my Anki decks (actually two, public and private..), but ideally I could make it easy for others to take subdecks for their own uses. So my half strategy has been to use CrowdAnki to export my main subdecks into subfolders in that repository. Those decks are probably still too broad, as my technical deck for example includes everything from Python syntax to shell commands and more. Also, I like to see the changes at a glance in a given commit, but the JSON invariably involves so many changes the diff is basically useless visually and is too big. My half solution there has been to simultaneously export the plain text notes and place it alongside the JSON. That way I can look at the diff and more easily see what was added on single lines.

I'm still getting the feel for what my process should be, hence my not being very vocal yet about possible changes. A lot about Anki frustrates me (especially template programming limitations), but it's still better than anything else!

ELLIOTTCABLE commented 7 years ago

Just a :+1: here on @CNG's mention of a “Dotfiles” repo — the amount of effort I'm putting into my Anki setup, none of which is being versioned or archived, is making me really uncomfortable. I'm interested in this plugin, only partially for “collaboration” — but much more for the backing-up, historical information about, and undo-ing, of my Anki database.

Pursuant to this:

  1. I'd really love to see “all decks” exporting fixed — it's mentioned somewhere that you don't support this, but I can't imagine why? Especially if you support the export of multiple decks in one directory, as long as they're named like::this? :P

  2. It'd be really nice to see support for archiving / restoration of a couple “global” settings … most notably, the anki.latex.latexCmds command (when using “Edit LaTeX build process”), amongst other things.

  3. Finally, and I'll expand upon this elsewhere, but I'd love to see automatic committing of changes upon synchronization. (See #19!)

I won't make any demands of a fellow FOSS developer; but I hope this gives you some insight into what your users want!

evolverine commented 6 years ago

I and @Alfredgg are looking into this, ie into helping with git integration out of the box. we'll be working only once every two weeks, so it will be slow, but hopefully useful. @Stvad did you make any progress on it in the meantime?

Stvad commented 6 years ago

Hey, @evolverine awesome! No, I haven't looked into this yet. Please keep me updated on your thoughts and progress! And feel free to reach out to me if you have any questions 🙂

Stvad commented 5 years ago

@CNG @evolverine @alfredgg @nicolas-raoul the recent update takes a step towards enabling this, by introducing an associated git repo for each deck. CrowdAnki would maintain those repos, with the changes you introduce to the decks.

evolverine commented 5 years ago

Way to go, @Stvad! I and @alfredgg have just tested it, and opened a few tickets for improvements. My personal goal is to get to a place where users who don't know anything about git can use this to collaborate on anki cards with others. But it's already a fabulous milestone, because we were trying to do the same thing late last year, and we got a bit stuck with the many python modules that we had to include, and weren't very sure how. So from now on it should all be easier.

Stvad commented 5 years ago

My personal goal is to get to a place where users who don't know anything about git can use this to collaborate on anki cards with others.

It'd be great, but hard to accomplish. I foresee a lot of work required around merging things 🙂

Please keep me up to date on your effort! And feel free to reach out regarding any questions you have!

evolverine commented 4 years ago

For future reference, posting here the library found by @katrinleinweber, PyGithub, and one for GitLab, also with the ability to fork repos.