Go to file
Damien Elmes be994f4102 add support for custom undo steps, and merging multiple actions
Allows add-on authors to define their own label for a group of undoable
operations. For example:

def mark_and_bury(
    *,
    parent: QWidget,
    card_id: CardId,
) -> CollectionOp[OpChanges]:
    def op(col: Collection) -> OpChanges:
        target = col.add_custom_undo_entry("Mark and Bury")
        col.sched.bury_cards([card_id])
        card = col.get_card(card_id)
        col.tags.bulk_add(note_ids=[card.nid], tags="marked")
        return col.merge_undo_entries(target)

    return CollectionOp(parent, op)

The .add_custom_undo_entry() is for adding your own custom actions.
When extending a standard Anki action, instead store `target = 
col.undo_status().last_step` after executing the standard operation.

This started out as a bigger refactor that required a separate
.commit_undoable() call to be run after each operation, instead of
having each operation return changes directly. But that proved to be
somewhat cumbersome in unit tests, and ran the risk of unexpected
behaviour if the caller invoked an operation without remembering to
finalize it.
2021-05-06 16:39:06 +10:00
.buildkite add header check to Linux CI 2021-04-13 23:08:57 +10:00
.github/ISSUE_TEMPLATE add issue template config.yml 2021-02-19 14:11:21 +10:00
cargo report pinned package issues upstream 2021-04-27 23:11:22 +10:00
docs add an updated script to run mypy as a daemon 2021-04-14 18:10:38 +10:00
ftl update backend to support undoing of notetype changes 2021-04-30 12:54:59 +10:00
pip Revert "add formatting experiment for posterity" 2021-04-14 19:12:14 +10:00
platforms add linux_arm64 platform 2020-12-29 18:40:39 +10:00
pylib add support for custom undo steps, and merging multiple actions 2021-05-06 16:39:06 +10:00
qt fix dmypy action 2021-05-05 15:54:41 +10:00
rslib add support for custom undo steps, and merging multiple actions 2021-05-06 16:39:06 +10:00
scripts add script to run Rust Analyzer using Bazel's build products 2021-05-04 20:06:42 +10:00
ts fix properties missing from generated Svelte .d.ts files 2021-05-04 18:55:58 +10:00
.bazelignore initial Bazel conversion 2020-11-01 14:26:58 +10:00
.bazelrc update to latest rules_rust incremental compilation 2021-04-09 12:48:24 +10:00
.bazelversion update pinned Bazel version to 4.0 release 2021-01-21 19:58:41 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore add script to run Rust Analyzer using Bazel's build products 2021-05-04 20:06:42 +10:00
bazel.bat initial Bazel conversion 2020-11-01 14:26:58 +10:00
BUILD.bazel add script to run Rust Analyzer using Bazel's build products 2021-05-04 20:06:42 +10:00
Cargo.lock update Rust deps 2021-04-27 22:18:12 +10:00
Cargo.toml add a valid, empty file so the check action works in Rust Analyzer 2021-05-05 15:53:27 +10:00
CONTRIBUTORS Added to CONTRIBUTORS 2021-04-22 00:58:59 -04:00
defs.bzl bump version 2021-05-04 16:24:28 +10:00
late_deps.bzl add script to run Rust Analyzer using Bazel's build products 2021-05-04 20:06:42 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
protobuf.bzl add linux_arm64 platform 2020-12-29 18:40:39 +10:00
python.bzl use PYTHON_SYS_EXECUTABLE for setting path to Python 2020-12-23 21:53:13 +10:00
README.md minor doc updates 2020-12-11 22:37:12 +10:00
repos.bzl update translations 2021-04-25 22:06:05 +10:00
run proper fix for __pycache__ folders preventing remove on ./run 2021-01-12 18:47:08 +10:00
run.bat enable Python warnings when running 2020-12-16 14:59:04 +10:00
WORKSPACE packages.bzl -> repos.bzl; update rules_rust 2020-11-05 14:22:45 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/#/

For more information on building, please see Development.