Coder Social home page Coder Social logo

anki-copy-currentcard-in-add-card's Introduction

Copy current deck/tags in add card

Rationale

You may want to add a note related to the current card, and so have it in the same deck and with the same tags as the current card. This is especially useful if you use filtered decks or nested decks. This add-on simply ensures that, when you are reviewing a card and open the "add-card" window, its deck will be the deck of the card you are reviewing, and it will copy its tags.

This was commissioned for 20$.

Internal

It changes AddCards.__init__, and call the previous method. In anki 2.1.24 hopefully it'll use a hook.

Links, licence and credits

Key Value
Copyright Arthur Milchior [email protected]
p4nix
Based on Anki code by Damien Elmes [email protected]
License GNU GPL, version 3 or later; http://www.gnu.org/licenses/gpl.html
Source in https://github.com/Arthur-Milchior/anki-copy-currentcard-in-add-card
Addon number 676957592

anki-copy-currentcard-in-add-card's People

Contributors

arthur-milchior avatar guillem-palau-salva avatar p4nix avatar

Watchers

 avatar  avatar

anki-copy-currentcard-in-add-card's Issues

Anki 2.1.45b3 bug

Hello Arthur,

I'm currently experimenting a bit with the new betas and have noticed this add-on stopped working due to the removal of the setDeckName function in the deck chooser. I don't really want to do a pull request, but I did a quick fix:

from aqt import gui_hooks, mw
from aqt.addcards import AddCards


def init(add_cards):
    editor = add_cards.editor
    note = editor.note
    if note is None:
        return
    if mw.state != "review":
        return
    reviewer = mw.reviewer
    current_card = reviewer.card
    if current_card is None:
        return
    current_note = current_card.note()
    editor.note.setTagsFromStr(current_note.stringTags())
    editor.updateTags()
    current_did = current_card.odid or current_card.did
    add_cards.deckChooser.selected_deck_id = current_did

gui_hooks.add_cards_did_init.append(init)

I don't know how many people use this add-on (I doubt there are too many more users than me), so feel free to decide whether you want to go through the hassle of updating the add-on on AnkiWeb :)

Best regards
p4nix

Problem with new versions (2.1.48)

Hey man, what's up?!

First, I love your addon; for me, it is very useful, especially when I add new information about a subject days after...

Second, the addon don't run in Anki 2.1.48 :(

I hope you, in your time free, fix it!

Thanks; from Brazil (forgive my worst english)

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.