Use anki-connect version 6

This commit is contained in:
louie 2020-03-09 18:08:33 +08:00
parent 58cad3a287
commit c74e864a64
3 changed files with 3 additions and 17 deletions

View file

@ -24,6 +24,8 @@
2. Variable ~anki-editor-html-head~ 2. Variable ~anki-editor-html-head~
3. Command ~anki-editor-copy-styles~ 3. Command ~anki-editor-copy-styles~
4. Command ~anki-editor-remove-styles~ 4. Command ~anki-editor-remove-styles~
11. Updated anki-connect to version 6
1. ~anki-editor-api-upgrade~ removed
** v0.3.3 ** v0.3.3

View file

@ -73,7 +73,6 @@ there are any ambiguity or grammatical mistakes ;-)/
| anki-editor-export-subtree-to-html | Export the subtree at point to HTML. | | anki-editor-export-subtree-to-html | Export the subtree at point to HTML. |
| anki-editor-convert-region-to-html | Convert and replace region to HTML. | | anki-editor-convert-region-to-html | Convert and replace region to HTML. |
| anki-editor-api-check | Check if correct version of AnkiConnect is running. | | anki-editor-api-check | Check if correct version of AnkiConnect is running. |
| anki-editor-api-upgrade | Upgrade AnkiConnect. |
| anki-editor-sync-collections | Synchronize your local anki collection. | | anki-editor-sync-collections | Synchronize your local anki collection. |
| anki-editor-gui-browse | Open Anki Browser with a query for current note or deck. | | anki-editor-gui-browse | Open Anki Browser with a query for current note or deck. |
| anki-editor-gui-add-cards | Open Anki Add Cards dialog with presets from current note entry. | | anki-editor-gui-add-cards | Open Anki Add Cards dialog with presets from current note entry. |

View file

@ -121,7 +121,7 @@ For example, you can put custom styles or scripts in this variable."
;;; AnkiConnect ;;; AnkiConnect
(defconst anki-editor-api-version 5) (defconst anki-editor-api-version 6)
(cl-defun anki-editor--fetch (url (cl-defun anki-editor--fetch (url
&rest settings &rest settings
@ -898,21 +898,6 @@ When note heading is not provided, it is used as the first field."
(error "anki-editor requires minimal version %d of AnkiConnect installed" (error "anki-editor requires minimal version %d of AnkiConnect installed"
anki-editor-api-version)))) anki-editor-api-version))))
(defun anki-editor-api-upgrade ()
"Upgrade AnkiConnect to the latest version.
This will display a confirmation dialog box in Anki asking if you
want to continue. The upgrading is done by downloading the latest
code in the master branch of its Github repo.
This is useful when new version of this package depends on the
bugfixes or new features of AnkiConnect."
(interactive)
(when (yes-or-no-p "This is going to download the latest AnkiConnect from the Internet to your computer, do you want to continue? ")
(let ((result (anki-editor-api-call-result 'upgrade)))
(when (and (booleanp result) result)
(message "AnkiConnect has been upgraded, you might have to restart Anki for the changes to take effect.")))))
(defun anki-editor-sync-collections () (defun anki-editor-sync-collections ()
"Synchronizes the local anki collections with ankiweb." "Synchronizes the local anki collections with ankiweb."
(interactive) (interactive)