{"id":15017286,"url":"https://github.com/anki-editor/anki-editor","last_synced_at":"2025-10-07T00:15:51.802Z","repository":{"id":62267689,"uuid":"398636335","full_name":"anki-editor/anki-editor","owner":"anki-editor","description":"Emacs minor mode for making Anki cards with Org Mode","archived":false,"fork":false,"pushed_at":"2025-07-23T09:20:29.000Z","size":42884,"stargazers_count":145,"open_issues_count":15,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-23T11:27:41.908Z","etag":null,"topics":["anki","emacs","flashcards","org-mode"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"louietan/anki-editor","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anki-editor.png","metadata":{"files":{"readme":"README.org","changelog":"Changelog.org","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-21T19:02:02.000Z","updated_at":"2025-07-23T09:20:33.000Z","dependencies_parsed_at":"2024-09-20T14:30:59.843Z","dependency_job_id":"7dd920b5-dd4b-46d5-8414-22fd8e353f62","html_url":"https://github.com/anki-editor/anki-editor","commit_stats":{"total_commits":182,"total_committers":19,"mean_commits":9.578947368421053,"dds":"0.46703296703296704","last_synced_commit":"dc0111527b99445689ec043ae9a8a7d8504c4949"},"previous_names":["anki-editor/anki-editor","orgtre/anki-editor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anki-editor/anki-editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-editor%2Fanki-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-editor%2Fanki-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-editor%2Fanki-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-editor%2Fanki-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anki-editor","download_url":"https://codeload.github.com/anki-editor/anki-editor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-editor%2Fanki-editor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278700022,"owners_count":26030635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","emacs","flashcards","org-mode"],"created_at":"2024-09-24T19:50:15.671Z","updated_at":"2025-10-07T00:15:51.796Z","avatar_url":"https://github.com/anki-editor.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"[[https://github.com/anki-editor/anki-editor/actions/workflows/tests.yml/badge.svg]]\n\n* anki-editor\n\nanki-editor is an [[https://www.gnu.org/software/emacs/emacs.html][Emacs]] minor mode for making [[https://apps.ankiweb.net][Anki]] cards with [[https://orgmode.org][Org Mode]].\n\nThis repository is a fork of [[https://github.com/louietan/anki-editor][louietan/anki-editor]]. By now there are quite a few differences and extensions compared to the original:\n- The develop branch of the original has been merged into the master branch; see the unreleased section of [[https://github.com/orgtre/anki-editor/blob/master/Changelog.org][Changelog.org]] for a list of the new features that come with this.\n- Almost all outstanding pull requests to the original have been integrated; [[https://github.com/orgtre/anki-editor/issues/10][this issue]] tracks the two exceptions.\n- A more flexible note structure, outlined [[https://github.com/eyeinsky/org-anki/issues/48#issuecomment-1216625730][here]], has been introduced.\n- The commands to push notes, delete notes, and insert notes have been improved.\n- A [[https://github.com/orgtre/anki-editor/issues/13][transient interface]] to all commands has been created.\n\nSee the [[https://github.com/louietan/anki-editor/compare/master...orgtre:anki-editor:master][commit log]] for a full list of differences. Note that this README does not reflect all the changes and additions yet.\n\n\n** Installation\n\n*** External dependencies\n\nOther than Emacs you need [[https://apps.ankiweb.net][Anki]], its [[https://github.com/FooSoft/anki-connect][AnkiConnect]] add-on, and [[https://curl.se][curl]] to use anki-editor. Because of AnkiConnect, anki-editor-mode needs Anki to be running (see [[https://github.com/orgtre/anki-editor/issues/5#issuecomment-1295857747][issue]] for explanation).\n\n*** Using ~package-vc.el~\n\nIf you are on Emacs 29 and newer, you can use ~package-vc-install~:\n\n#+BEGIN_SRC emacs-lisp\n  (package-vc-install\n   '(anki-editor . (:url \"https://github.com/anki-editor/anki-editor\")))\n#+END_SRC\n\nAdditionally, [[https://github.com/slotThe/vc-use-package][vc-use-package]] provides use-package integration:\n\n#+begin_src emacs-lisp\n  (use-package anki-editor\n    :vc (:fetcher github :repo anki-editor/anki-editor))\n#+end_src\n\nAlternatively, if you're on Emacs 30, a ~:vc~ keyword is built into use-package:\n\n#+begin_src emacs-lisp\n  (use-package anki-editor\n    :vc (:url \"https://github.com/anki-editor/anki-editor\" :rev :newest))\n#+end_src\n\n*** Manually\n\nIf you're using the built-in =package.el= package manager, first manually download this repository and then type the following in Emacs:\n\n: M-x package-install-file [RET] \"path/to/anki-editor.el\" [RET]\n\nYou can also first visit =anki-editor.el= in an Emacs buffer and then type =M-x package-install-from-buffer [RET]=. Both will install the anki-editor package, including uninstalled Elisp dependencies, into =package-user-dir= (=~/.emacs.d/elpa= by default), generate autoloads, and set up =load-path=.\n\n*** Using straight.el\n\nIf you're using [[https://github.com/radian-software/straight.el][straight.el]] as package manager, install by adding this to your =init.el=:\n\n#+begin_src elisp\n(use-package anki-editor\n  :defer t\n  :straight (:repo \"anki-editor/anki-editor\"))\n#+end_src\n\n*** With Doom Emacs\n\nIf you use Doom Emacs, add the followings to ~packages.el~ and ~config.el~ respectively.\n\n#+begin_src emacs-lisp\n  (package! anki-editor\n    :recipe (:host github :repo \"anki-editor/anki-editor\"))\n#+end_src\n\n#+begin_src emacs-lisp\n  (use-package! anki-editor)\n#+end_src\n\n** Usage\n\n*** The Layout of Notes\n**** Note and Fields General Information\n   The power of this mode comes from the builtin HTML export backend\n   provided by Org, which enables you to use almost all the Org\n   constructs for writing Anki notes: lists, code blocks, tables,\n   latex and so on.\n\n   The structure of a note is as follows, which is inspired by\n   ~org-drill~.  Check out [[./examples.org][examples.org]] for more examples.\n\n   #+BEGIN_SRC org\n     ,* Raining                                                      :vocab:idioms:\n       :PROPERTIES:\n       :ANKI_DECK: English\n       :ANKI_NOTE_TYPE: Basic (and reversed card)\n       :ANKI_TAGS: vocab idioms\n       :END:\n     ,** Front\n        (it's) raining cats and dogs\n     ,** Back\n        it's raining very hard\n     ,* Is there a shorter way to write notes?\n        :PROPERTIES:\n        :ANKI_NOTE_TYPE: Basic\n        :END:\n\n     ,** Back\n\n        Yes, like this one, Front is missing, ~anki-editor~ will use note\n        heading as Front.  This is neat as sometimes it's verbose to repeat\n        the same content in note heading and first field.\n\n        This works for all note types, just make one field absent and\n        ~anki-editor~ will use note heading as that missing field.\n\n     ,* Is there a an even shorter way to write notes?\n        :PROPERTIES:\n        :ANKI_NOTE_TYPE: Basic\n        :END:\n\n        Yes, like this one, Front and Back is missing, ~anki-editor~ will use note\n        heading as Front and the text after as Back.  This is neat as sometimes it's verbose to repeat\n        the same content in note heading and first field.\n\n        This works for all note types, just make the first 2 fields absent and\n        ~anki-editor~ will use note heading as first field and the text below the heading as second field.\n\n     ,* You can extract a field value from an org-property\n        :PROPERTIES:\n        :ANKI_NOTE_TYPE: Basic\n        :ANKI_FIELD_FRONT: Can one define an anki-field inside an org-mode property?\n        :ANKI_PREPEND_HEADING: nil\n        :END:\n\n        Yes. In this example, =anki-editor=  will use the =ANKI_FIELD_FRONT= property value as\n        a front side of the Anki card and the body of the card as its back.\n\n     ,** Front\n        Notice that property fields will override subheading fields.\n        This block will be skipped\n   #+END_SRC\n\n   - Anki deck is provided by ~ANKI_DECK~ property.  This property is\n     retrieved with inheritance, that is to say, it can be put in any\n     ancestor entries or at top of the file by ~#+PROPERTY: ANKI_DECK DeckName~.\n   - Sub decks (nested decks) are supported via ~::~ delimiters.\n     For example, to push a card to the sub deck ~SubDeck~ inside of\n     ~SuperDeck~, set ~:ANKI_DECK:~ to ~SuperDeck::SubDeck~.\n   - ~ANKI_NOTE_TYPE~ property is to specify the Anki note type of a\n     note and is also required for identifying an Anki note entry.\n   - Anki tags can be provided in two ways:\n     1. With a ~ANKI_TAGS~ property, multiple tags are separated by spaces\n     2. With Org tags [fn:1], this could be turned off if you would\n        like to keep Org tags separated from Anki tags\n   - Child entries of a note entry are fields.\n\n   Typing all these information by hand could be inefficient and prone\n   to errors, so this package provides an interactive command\n   ~anki-editor-insert-note~ to help with this and hooks up\n   auto-completions for decks, note types and tags etc.\n\n[fn:1] It should be noted that Org only allows letters, numbers, =_=\nand ~@~ in a tag but Anki allows more, so you may have to edit you\nAnki tags before they can be used in Org without any surprise.\n**** Controlling HTML Formatting\nBy default, anki-editor converts Org syntax to HTML when exporting to Anki.\nThe =:ANKI_FORMAT: nil= property can be used at the *note* level to disable this conversion for the entire note.\n\nIf you want to use both raw text fields and HTML-converted fields within a single note, you can now use the =# raw= prefix *within a field* to indicate that the field's content should be treated as raw text, bypassing HTML conversion.\nAny spaces, tabs, or newlines immediately following =# raw= are ignored.\n\n#+BEGIN_SRC org\n,* Example Note with Mixed Formatting\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Basic\n:END:\n\n,** Front\nThis field will be converted to HTML.\n- This is a list.\n- It will be rendered as an HTML list.\n\n,** Back\n# raw\nThis field will be treated as RAW text.\nIt will be sent to Anki exactly as written.\n#+END_SRC\n\n*** Commands\nTo see the docs for the most recent commands use M-x describe-function (for more info see [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Name-Help.html][Emacs Manual - Help Commands]])\n\n   | Command                            | Description                                                                                                                    |\n   |------------------------------------+--------------------------------------------------------------------------------------------------------------------------------|\n   | anki-editor-mode                   | Toggle this minor mode.                                                                                                        |\n   | anki-editor-push-notes             | Push notes to Anki. Additional arguments can be used to restrict the range of notes.                                           |\n   | anki-editor-push-new-notes         | Similar to ~anki-editor-push-notes~, but push those that are without ~ANKI_NOTE_ID~.                                           |\n   | anki-editor-retry-failed-notes     | Similar to ~anki-editor-push-notes~, except that it only pushes notes with ~ANKI_FAILURE_REASON~.                              |\n   | anki-editor-insert-note            | Insert a note entry like ~M-RET~, interactively.  When note heading is not provided or is blank, it's used as the first field. |\n   | anki-editor-delete-notes           | Delete notes or the note at point.                                                                                             |\n   | anki-editor-cloze-dwim             | Cloze current active region or a word the under the cursor.                                                                    |\n   | anki-editor-export-subtree-to-html | Export the subtree at point to HTML.                                                                                           |\n   | anki-editor-convert-region-to-html | Convert and replace region to HTML.                                                                                            |\n   | anki-editor-api-check              | Check if correct version of AnkiConnect is running.                                                                            |\n   | anki-editor-sync-collections       | Synchronize your local anki collection.                                                                                        |\n   | anki-editor-gui-browse             | Open Anki Browser with a query for current note or deck.                                                                       |\n   | anki-editor-gui-add-cards          | Open Anki Add Cards dialog with presets from current note entry.                                                               |\n\n*** Variables\nTo see the docs for the most recent commands use M-x describe-variable (for more info see [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Name-Help.html][Emacs Manual - Help Commands]])\n\n   | Name                                          | Default Value          | Description                                                                                              |\n   |-----------------------------------------------+------------------------+----------------------------------------------------------------------------------------------------------|\n   | anki-editor-api-host                          | \"127.0.0.1\"            | The network address AnkiConnect is listening.                                                            |\n   | anki-editor-api-port                          | \"8765\"                 | The port number AnkiConnect is listening.                                                                |\n   | anki-editor-break-consecutive-braces-in-latex | nil                    | If non-nil, consecutive \"}\" will be automatically separated by spaces to prevent early-closing of cloze. |\n   | anki-editor-ignored-org-tags                  | '(\"export\" \"noexport\") | A list of Org tags that are ignored when constructing notes form entries.                                |\n   | anki-editor-org-tags-as-anki-tags             | t                      | If nil, tags of entries wont't be counted as Anki tags.                                                  |\n   | anki-editor-protected-tags                    | '(\"marked\" \"leech\")    | A list of tags that won't be deleted from Anki even though they're absent in Org entries.                |\n   | anki-editor-latex-style                       | builtin                | The style of latex to translate into.                                                                    |\n   | anki-editor-include-default-style             | t                      | Wheter or not to include `org-html-style-default' when using `anki-editor-copy-styles'.                  |\n   | anki-editor-html-head                         | nil                    | Additional html tags to append to card stylings when using `anki-editor-copy-styles'.                    |\n   | anki-editor-note-match                        | nil                    | Additional matching string for mapping through anki note headings.                                       |\n\n*** Functions and Macros\n\n**** anki-editor-map-note-entries\n\n    Simple wrapper that calls ~org-map-entries~ with\n    ~\u0026ANKI_NOTE_TYPE\u003c\u003e\\\"\\\"~ appended to MATCH.\n\n**** anki-editor-api-call\n\n    Invoke AnkiConnect with ACTION and PARAMS.\n\n**** anki-editor-api-call-result\n\n    Calls above, returns result field or raise an error.\n\n**** anki-editor-api-with-multi\n\n    Used in combination with ~anki-editor-api-enqueue~ to queue\n    multiple api calls and combine them into one 'multi' call at the\n    end, return the results of these calls in the same order.\n\n    Usage:\n    #+begin_src elisp\n      (cl-destructuring-bind (decks models tags notes)\n          (anki-editor-api-with-multi\n           ;; The following api calls will be combined into one 'multi' call.\n           (anki-editor-api-enqueue 'deckNames)\n           (anki-editor-api-enqueue 'modelNames)\n           (anki-editor-api-enqueue 'getTags)\n           (anki-editor-api-enqueue 'findNotes :query \"deck:Default\"))\n        (message (concat \"decks: %S\\n\"\n                         \"models: %S\\n\"\n                         \"tags: %S\\n\"\n                         \"notes: %S\")\n                 decks models tags notes))\n    #+end_src\n\n**** anki-editor-api-enqueue\n\n    Like ~anki-editor-api-call~, but is only used in combination with\n    ~anki-editor-api-with-multi~.  Instead of sending the request\n    directly, it simply queues the request.\n\n**** anki-editor-note-at-point\n\n    Make a note struct from current entry.\n\n**** anki-editor-find-notes\n\n    Find notes with QUERY.\n\n**** anki-editor-copy-styles\n\n    Copy ~org-html-style-default~ and ~anki-editor-html-head~ to Anki card stylings.\n\n**** anki-editor-remove-styles\n\n    Remove from card stylings html tags generated by this mode.\n\n** Limitations\n\n*** Tags between Anki and Org\n\n   Because the set of characters allowed in tags is different between\n   Anki and Org, you have to make sure that tags from Anki are\n   compatible with Org and tags in Org could be recognized by Anki.\n\n*** Working with Anki add-ons\n\n   This package might not work well with certain Anki add-ons\n   especially those who extend the builtin Anki note editor to\n   automatically fill note field content (e.g. ~Add note id~).\n\n*** One Way Sync with Anki\n\nTo sync anki notes and decks to org see ([[https://github.com/orgtre/ankiorg][orgtre/ankiorg]]).\n\nThe following items are not synchronized to org:\n - Deletion of Notes\n - Deck Changes\n\n** Demo\n\n  [[./demo.gif]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-editor%2Fanki-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanki-editor%2Fanki-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-editor%2Fanki-editor/lists"}