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

GitHub integration #2

Open
nicolas-raoul opened this issue Sep 1, 2016 · 11 comments
Open

GitHub integration #2

nicolas-raoul opened this issue Sep 1, 2016 · 11 comments

Comments

@nicolas-raoul
Copy link

nicolas-raoul commented Sep 1, 2016

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
Copy link
Owner

Stvad commented Sep 11, 2016

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
Copy link

CNG commented May 10, 2017

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
Copy link
Owner

Stvad commented Jul 11, 2017

@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
Copy link

CNG commented Jul 11, 2017

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
Copy link

ELLIOTTCABLE commented Sep 10, 2017

Just a 👍 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 Automated committing of changes upon AnkiWeb synchronization #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
Copy link
Contributor

evolverine commented Sep 26, 2018

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?

@nicolas-raoul nicolas-raoul changed the title Github integration GitHub integration Sep 27, 2018
@Stvad
Copy link
Owner

Stvad commented Sep 28, 2018

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
Copy link
Owner

Stvad commented Mar 16, 2019

@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.

@Stvad Stvad added the git label Mar 21, 2019
@evolverine
Copy link
Contributor

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
Copy link
Owner

Stvad commented Apr 6, 2019

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
Copy link
Contributor

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

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

No branches or pull requests

5 participants