louietan / anki-editor Goto Github PK
View Code? Open in Web Editor NEWEmacs minor mode for making Anki cards with Org
Emacs minor mode for making Anki cards with Org
By default (and I don't know the easy way to change this behavior) org-mode
exports underlined text into HTML as <span class="underline">some text</span>
which results into ignoring underlining by Anki.
I see two solutions to the problem:
org-mode
hooks and filters (as in 12.17 Advanced configuration).underline {
text-decoration: underline;
}
I think the second way is preferable (since writing down the proper regex might be burdensome) and should be added to the documentation of anki-editor
.
P.S. Thanks for the great minor-mode!
Anki can't process the content transformed from the snippet below
\begin{vmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{vmatrix}
which becomes
<p>
[latex] \begin{vmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{vmatrix}
[/latex]</p>
Anki reports an error saying "Missing $ inserted".
It works when modified to the following style
<p>
[$] \begin{vmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{vmatrix}
[/$]</p>
Default Front to note name if the Front field is not defined.
That way we could write:
* How much is the fish?
** Front
How much is the fish?
** Back
This much!
as
* How much is the fish?
** Back
This much.
Much love. I will try to look into this this weekend. But maybe this functionality exists already.
Cheers!
I use you sample org file to submit, got error:
Fetching decks...
anki-editor-insert-deck: Unexpected error communicating with AnkiConnect: End of file while parsing JSON, the response was ""
What should i do?
:ANKI_FAILURE_REASON: Unknown "#s(org-export-backend nil html ((latex-fragment . anki-editor--ox-latex) (latex-environment . anki-editor--ox-latex)) nil nil nil nil)" back-end: Aborting export
This is my first try¸ a simple test doc, without any latex:
** This
:PROPERTIES:
:ANKI_DECK: New
:ANKI_NOTE_TYPE: Basic
:END:
*** Front
Front
*** Back
Back
Deck "New" does exist in Anki. Below my spacemacs system info:
(ruby python elpy clojure haskell html yaml helm auto-completion emacs-lisp git markdown org asciidoc deft spell-checking version-control typography themes-megapack)
It would be nice to not just push notes but also to be able to fetch the notes that have been pushed. This way any changes made in Anki would remain in sync. As of now my org files are only used once - to make the cards. If fetching was possible, the org files that create the anki cards could be maintained and used repeatedly. These org files would also be easier to read and review - which is harder in the inbuilt anki editor.
if the property drawer is empty like this
** Back
:PROPERTIES:
:END:
and I push this note into Anki I expected an empty Back field. But in the field Back I get this html source code:
<p>
:PROPERTIES:
nil:END:
</p>
I think an empty property drawer is unusual but valid according to the org syntax? I think this is an error. Unfortunately I don't know how to change your source code.
I ran into this issue because when I deleted the only property from a drawer but left these opening and closing elements.
Thanks for your time and great software!
Hei Lei
Thank you for that great package. May I ask how you bound the keymaps in the gif animation from the readme.org? In my case (Spacemacs) after enabling anki-editor-mode
hitting Spc i n
has no function whereas S-Right
or S-Left
work as TODO
and DONE
cycle switches. Would be great if you could point me to any direction towards such a streamlined workflow as displayed in your helpful gif.
I'm trying to build a vocabulary deck, and the following note does not upload the .mp3 file to anki, and doesn't link it as a sound file either.
#+PROPERTY: ANKI_DECK French::My words
* soir :male:
:PROPERTIES:
:ANKI_NOTE_TYPE: What does this word mean?
:ANKI_NOTE_ID: 1542420645039
:END:
*** sort
99
*** French
soir
*** Grammar
*** Pronunciation
swaʁ
*** Audio
[[file:/Users/asf/Desktop/French/recordings/soir.mp3][soir]]
*** Image
(empty)
*** Association / sentence
(empty)
Using M-x anki-editor-push-notes
in that buffer results in a note with a HTML link to that file in the given field (as file:/Users/asf/Desktop/French/recordings/soir.mp3
), but the note isn't set up to play the audio file at all. The Anki database does not contain the media file and *Messages*
doesn't contain mentions of the media file being uploaded.
From reading the source code, it looks like the advice around org-html-link
in anki-editor--ox-html-link
is intended to do that, but in my org-mode installation (Org mode version 9.1.14 (release_9.1.14-1012-g643481 @ /Users/asf/.emacs.d/straight/build/org/)
), it does not seem to be getting called - I used edebug-defun
to see what happens in this function, but when pushing the buffer's notes, it isn't used at all.
I'm confused - Am I using media file references wrong? Or is this a problem with anki-editor instead?
Your software is really useful as is. In fact it's so great that I had the idea to use your package to collaborate with a friend to create an Anki Deck together for one course. This is not a big project so all notes we create fit into one org-document that we want to share/sync/version via git.
But I think using note-ids prevents this: When I run anki-editor-push-notes new notes are created in Anki and their note-id is written back into a property drawer in the file. The nid/note-id is the creation time in milliseconds. When my friend get this file the note-ids in the file will not be in his collection. So they are at least useless to him (?). At the moment it's even worse: It seems that if a note-id property is present anki-editor tries to update this note. If the note is not in Anki (maybe it was deleted or it's a different profile) nothing happens and anki-editor reports a successful import. I think this shouldn't happen. Can other people replicate this behavior?
I wonder if using an org-id (an uuid) would be an alternative? This uuid will always be unique and doesn't change on import into Anki. In the Anki note the org-id could be stored in a separate field. One problem with this is that fields can always be accidently changed by a user. One option to prevent this would be to use an addon that hides such a field from the editor component (in the edit/add window and the browser). The add-on Image Occlusion Enhanced brings its own note type that has a field called 'id' which is hidden from the editor view with this function which could be extracted and reused.
I know that anki-editor wasn't created for this workflow ("it's for temporarily editing note with Org buffer in Emacs, in which case the Org file isn't meant to be kept", source). But I think this would be a great extension.
Did I miss something or would using an org-id really offer an advantage?
Hi, I was able to get card submitting to work, but although it says "1 card submitted", it adds two cards to the deck:
* Prayer words :deck:
** Vocabulary
*** Item :note:
:PROPERTIES:
:ANKI_NOTE_TYPE: Basic (and reversed card)
:ANKI_TAGS: vocab idioms
:END:
**** Front
Hello
**** Back
World
Here is what I see:
I use Noweb reference syntax to embed some code in all my source blocks, which needs :noweb yes
in the source blocks' headers.
The code works perfectly fine when I execute the block myself, but anki-editor-push-notes
executes the blocks without the header, which leads to wrong outputs. I tried :cache yes
to avoid the problem, but anki-editor-push-notes
seems to ignore that too.
Here is a minimal example:
* Noweb Test :noexport:
#+name: enable_noweb
#+begin_src python
noweb = True
#+end_src
* Noweb Test
:PROPERTIES:
:ANKI_NOTE_TYPE: Basic
:ANKI_DECK: OrgTestDeck
:ANKI_NOTE_ID: 1536670156877
:END:
** Front
Noweb Enabled?
** Back
#+begin_src python :exports results :results output :noweb yes
noweb = False
<<enable_noweb>>
print("Noweb {0}.".format("enabled" if noweb else "not enabled"))
#+end_src
#+RESULTS:
: Noweb enabled.
The result of manual execution is Noweb enabled.
as expected, but the pushed card reads Noweb not enabled.
.
I am using Emacs 26.1, with Org Mode 9.1.14, and the latest anki-editor on Melpa.
If I select multiple sequential words for cloze deletion and give M-x anki-editor-cloze-region, then I get the following error.
(wrong-number-of-arguments (4 . 4) 2)
This happens when I select "computer network interface" in this tree and give the command.
* Virtual network interface
:PROPERTIES:
:ANKI_DECK: @IMPORT
:ANKI_NOTE_TYPE: Cloze
:ANKI_TAGS: Computer_networks
:END:
** Text
A [[https://en.wikipedia.org/wiki/Virtual_network_interface][virtual network interface]] ({{c1::VIF}}) is an abstract virtualized representation of a computer network interface that may or may not correspond directly to a [[https://en.wikipedia.org/wiki/Network_interface_controller][network interface controller]].
** Extra
Emacs gives the following backtrace.
Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 2)
anki-editor-cloze(385 393)
anki-editor-cloze-region(1 "")
funcall-interactively(anki-editor-cloze-region 1 "")
call-interactively(anki-editor-cloze-region record nil)
command-execute(anki-editor-cloze-region record)
execute-extended-command(nil "anki-editor-cloze-region" nil)
funcall-interactively(execute-extended-command nil "anki-editor-cloze-region" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
Hello!
Thank you very much for this project, It's been very helpful.
I was wondering what I need to do to use a custom note type with custom fields and such that I created my self. Is it as simple as placing it in the properties tray?
Thank!
AloiSama
I am running emacs25 on ubuntu 16 LTS, anki 2.032, anki connect is installed and running but every note that I try to submit (even the example) fails. Any tips?
It would be nice to be able to edit several similar notes using Column View. This could be done if notes supported using Org properties for fields instead of only subheadings.
Another interesting idea would be to support Org tables for defining several similar notes.
I'm getting strange coding systems errors if I try to push notes to anki. I'm using Anki 2.1.14 (7b93e985) and I have downgraded request.el to request 0.3.1, but I get still the error below. I'm pretty sure this not a problem of encoding in the files: I get the errors even if I make a very simple file like this http://ix.io/1PtE. Sometimes as you see I get a failure reason (but I have thee impression not always)...
:ANKI_FAILURE_REASON: Wrong number of arguments: (8 . 8), 10
These default coding systems were tried to encode text
in the buffer ‘ temp file’:
(utf-8-unix (245 . 4194242) (246 . 4194239) (249 . 4194243) (250 .
4194209) (607 . 4194242) (608 . 4194239) (611 . 4194243) (612 .
4194217) (961 . 4194243) (962 . 4194221) (1014 . 4194243))
However, each of them encountered characters it couldn’t encode:
utf-8-unix cannot encode these: ...
[etc.]
raw-text no-conversion
Thanks for your great package!
I think I found an error: If org-use-property-inheritance is set to non-nil it doesn't work as expected: Anki-Editor tries to import too many notes (one for each heading that represents a field) and in the properties for each heading that represents a field I get a property: ":ANKI_FAILURE_REASON: Missing note type".
In retrospect I think I understand why this error occurs ... But it took me some time to figure this out.
Outside of Anki-Editor property inheritance is quite useful for me. So maybe some other people use it too and run into the same problem?
If you can reproduce this you could include a warning in the readme or maybe even anki-editor-setup-minor-mode could set this variable to nil whereas anki-editor-teardown-minor-mode might restore the original value of the variable?
I use the addon Add Note ID. This is useful in certain cases if you export and import a deck so that for these cases it's recommended in the manul, see https://apps.ankiweb.net/docs/manual.html#exporting-text.
When I push a note from emacs to Anki I don't fill out the field "Note ID". The problem is that on some of my notes the field "Note ID" is the first field. If I have an empty first field I get an error ":ANKI_FAILURE_REASON: Note creation failed for unknown reason".
Having the first field as "Note ID" might be unusual but it's acceptable in Anki. So maybe some time in the future some other person might face the same problem. If you can reproduce this you could include a warning in the manual or maybe something in the code?
Anyway, thanks again for this very useful piece of software.
I use quite a lot images in my anki notes and in my org headers. It would be great to be able to export images too from anki-editor.
From what I understand, it seems like it's possible to submit assets using anki-connect
, hence it would be pretty neat if assets referenced in org-mode would automatically be submitted to anki upon calling anki-editor-submit
.
It seems like the following would have to be solved:
If this is something that would be interesting to include, I might be able to give it a go sometime this week.
First of, this package is great! Before I've been using a small personal script which copies a region, wraps latex and maths, thus I could just paste into a card in Anki. What you've got going her, is waaay better. Thank you!
When attempting to submit this card, the Back
is left blank.
If I then add some random text in front of *Perturbation Theory*
, e.g. abc *Perturbation Theory*
, it works.
*** Front
What's the purpose of *Perturbation Theory* ?
*** Back
*Perturbation Theory* provides a method for finding /approx./ energy eigenvalues and eigenstates for a system whose Hamiltonian is of the form
\begin{equation*}
\hat{H} = \hat{H}_0 + \hat{H}'
\end{equation*}
where $\hat{H}_0$ is the Hamiltonian of an /exactly/ solvable system, for which we know the eigenvalues, $E_n^{(0)}$, and eigenstates, $\ket{n^{(0)}}$, and $\hat{H}'$ is /small, time-independent perturbation/.
I'll be happy to help out if you need help!
Since 66889e6 on 2018-05-06, anki-editor only uses Org tags for tags in Anki notes. Please either allow users to revert to the old behavior or allow users to choose from both Org tags and from Anki tags.
I have tried using anki-editor since the 2018-05-06 change, and afterwards tagging notes from anki-editor gave poor results for two main reasons.
First, it conflicted with the popular Anki add-on Hierarchical Tags. That add-on allows tag hierarchies with the double colon "::" for the default divider. This obviously conflicts with Org's requirement that "tags must be preceded and followed by a single colon". For the record, hierarchical tags worked fine before the "Use Org tags as Anki tags" change.
Second, my Org tags and my Anki tags have very few common members. In fact, they come from different controlled vocabularies. The common Anki tags "marked" and "leech" appear nowhere in my Org tags. The common Org tags "@home" and "@work" appear nowhere in my Anki tags. Before the change anki-editor kept the two sets of tags separate by having Anki tags in Org properties.
Hoi there!
Thank you for your beautiful package! I was just wondering whether you thought or tried exporting images from code blogs via org-babel?
I often use graphviz code, PlantUML, DITAA or similar. Have you tried these?
For example I try the following org-mode code to generate a graph, but the image is not displayed or pushed to anki.
#+BEGIN_SRC dot :file test-dot.png :exports results
graph {
a -> b
}
#+END_SRC
Have you played with that in the past? I will try to investigate a bit later this week, but maybe you have a quick hint. Thanks again!
It's cumbersome to move the point to the deck or group heading in order to make note insertion command insert the note skeleton at a suitable place.
It would be better to ask the user under which headline they want to insert the note, or even better to make a strategy to select the best insertion point.
Same to deck insertion command.
when i run anki-editor-push-notes
i got this error: Wrong type argument: listp, 1564113163940
anki version: 2.1.11
Hi @louietan ,
thank you a lot for this add-on :) It's really useful!
I totally see the point for your proposed workflow.
I'd ask you if my workflow makes sense and you may want to consider it as an option in the future.
I create a lot of notes spread all over different Org files. And I'd like to push them to Anki. So having a note not under a Deck heading but rather to have the Deck as a property of a Note could be a solution for that.
Secondly there is a need for conversion from an ordinary note to an Anki note with respected properties set.
The note
tag is rather generic and can be used everywhere so probably :anki-note:
is better in the above case. Additionally setting Anki tags via ordinary tags and not via a property is a way how I'd manage it in an Org document.
What do you think about this workflow? Is it something we can think about and probably implement?
Best,
Andrei
When I run anki-editor-push-notes
I get :ANKI_FAILURE_REASON: Unrecognized keyword: "fish"
. I use the fish-shell (not bash) so it might somehow be related to that, but I don't know how to work around it. Here's an example I tried:
#+PROPERTY: ANKI_DECK Default
* Fact
:PROPERTIES:
:ANKI_NOTE_TYPE: Cloze
:ANKI_FAILURE_REASON: Unrecognized keyword: "fish"
:END:
** Text
Cards of this note wil be created in {{c1::Default::which deck ?}}
Please restore the command for appending tags with auto-completion.
It would be nice if there were a switch (e.g. a hierarchical property as ANKI_DECK
) to disable HTML conversion from org and just send the literal text to the corresponding field.
I find those <p>...</p>
a bit annoying and unnecessary.
As reference here: https://emacs-china.org/t/ox-hugo-auto-fill-mode-markdown/9547/12
When try to push notes I got this message
" Wrong type argument: symbolp, ("listp" result)"
Anki 2.0, emacs 25
I used git bisect and looks like this [commit](805bd23 broke it
is of the form
\begin{equation*}
\hat{H} = \hat{H}_0 + \hat{H}'
\end{equation*}
where
becomes
is of the form [latex]\begin{equation*} \hat{H} = \hat{H}_0 + \hat{H}' \end{equation*} [/latex]where
Could do one of the following:
:end
of previous element and :begin
of latex element, and insert what's missing\n
before and after a latex-environment
, since it's not that usual to inline something which ought to be wrapped in "[latex]%s[/latex]"Lastly I have problems creating new cards from anki-editor. The deck is created in Anki, and the sync works perfectly with created cards which has ANKI_NOTE_ID property.
When there are new cards in my org file, I execute anki-editor-push-notes and all notes are sync until the newest card. Then, the new card is created in anki, but the process freezes and stop synchronizing more cards. If I execute again anki-editor-push-notes, all cards are syncronized but the latest card has these property:
:ANKI_FAILURE_REASON: Note creation failed for unknown reason
The card is well created on Anki, but the note_id it's not returned. So, I think that the problem is copying the new note_id
Emacs Version: GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of 2019-04-12
Org: 20190624
Anki-editor: 20190608.1621
Anki: Version 2.1.13 (3ba55990)
AnkiConnect: 2019-06-02
At request-log
I've found this
[debug] REQUEST
[debug] Run: curl --silent --include --location --compressed --cookie /home/ppalazon/.emacs.d/request/curl-cookie-jar --cookie-jar /home/ppalazon/.emacs.d/request/curl-cookie-jar --write-out \n(:num-redirects %{num_redirects} :url-effective "%{url_effective}") --data-binary @/tmp/emacs-requestuk3b9c --request POST http://127.0.0.1:8765
[debug] REQUEST--CURL-CALLBACK event = finished
[debug] REQUEST--CURL-CALLBACK proc = #
[debug] REQUEST--CURL-CALLBACK buffer = #<buffer request curl>
[debug] REQUEST--CURL-CALLBACK symbol-status = nil
[debug] REQUEST--CALLBACK
[debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Type: text/json
Access-Control-Allow-Origin: *
Content-Length: 33
{"result": [null], "error": null}
[debug] REQUEST-RESPONSE--CANCEL-TIMER
[debug] -CLEAN-HEADER
[debug] -CUT-HEADER
[debug] error-thrown = nil
[debug] -PARSE-DATA
[debug] parser = json-read
[debug] data = ((result nil) (error))
[debug] symbol-status = success
[debug] Executing success callback.
[debug] REQUEST
[debug] Run: curl --silent --include --location --compressed --cookie /home/ppalazon/.emacs.d/request/curl-cookie-jar --cookie-jar /home/ppalazon/.emacs.d/request/curl-cookie-jar --write-out \n(:num-redirects %{num_redirects} :url-effective "%{url_effective}") --data-binary @/tmp/emacs-requestpwrYOV --request POST http://127.0.0.1:8765
[debug] REQUEST--CURL-CALLBACK event = finished
[debug] REQUEST--CURL-CALLBACK proc = #
[debug] REQUEST--CURL-CALLBACK buffer = #<buffer request curl>
[debug] REQUEST--CURL-CALLBACK symbol-status = nil
[debug] REQUEST--CALLBACK
[debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Type: text/json
Access-Control-Allow-Origin: *
Content-Length: 33
{"result": [null], "error": null}
[debug] REQUEST-RESPONSE--CANCEL-TIMER
[debug] -CLEAN-HEADER
[debug] -CUT-HEADER
[debug] error-thrown = nil
[debug] -PARSE-DATA
[debug] parser = json-read
[debug] data = ((result . [nil]) (error))
[debug] symbol-status = success
[debug] Executing success callback.
Hello and thank you for this awesome package.
I've been using it for 2 months and it was working great until now. For some reason I can't add any note using the push command. Also, I can't insert note with the interactive command.
I'm using the simpleste example, as provided by the tutorial.
What could be causing this?
Adding a tag with a dash creates two tags. For exmaple, "world-capitals" would be cteated as ":world:capitals:". Is there way to create one tag with a dash, like ":world-capitals:"?
E.g. \frac{x}{y^{z}}
will fail to compile when wrapped in a cloze for Anki, .e.g. {{c1::$\frac{x}{y^{z}}$}}
, as it will pre-emptively close the cloze.
I made an attempt at a fix # #9
I get the error "Submitted 1 notes, with 1 failed. Check property drawers for failure reasons." for the subtree below. The image file (attached) works fine in other Anki notes I've made, and submitting the subtree works if I omit the link.
*** Item :note:
:PROPERTIES:
:ANKI_NOTE_TYPE: jwd - Key sequences - (2015)
:ANKI_NOTE_ID: 1525220665974
:ANKI_FAILURE_REASON: Incorrect padding
:END:
**** Command description
Give a command name (for the duration of the Emacs session) to the
most recently defined keyboard macro (‘kmacro-name-last-macro’).
**** Key sequence
= *C-x C-k n* =
**** Command name
=(kmacro-name-last-macro)=
**** Program icon
[[file:/cygdrive/c/Users/owner/AppData/Roaming/Anki2/Knowledge%20Tree/collection.media/240px-EmacsIcon.svg.png][emacs]]
I'm unable to create notes and then update them after making changes.
I've created FooSoft/anki-connect#82 to reflect what I believe is the issue, but I wanted to ask here. Is anyone using this successfully? If so, what Anki and AnkiConnect versions are you using?
I'm trying to use anki-editor with an addon called Cloze Overlapper, basically I need to write a field which contains this syntax: [[oc1::text_to_hide]]. However, org-mode thinks it is a link and the export fails. Is there any workaround for this? Thank you for this awesome package.
I've a file with over 40 entries. I can push most of the entries, but some fail for an unknown reason.
Anki is up and running, the deck is set with a file-wide property and most notes are pushed successfully.
Example of successful entry:
** MIMD Strukturen :MIMD:
*** Shared Memory :Shared_Memory:
**** shared memory, programmiermodell
:PROPERTIES:
:ANKI_NOTE_TYPE: SysProg Frage
:ANKI_NOTE_ID: 1557473650187
:END:
***** Frage
Was ist bei einer MIMD Architektur mit gemeinsamen Speicher das Programmiermodell?
***** Antwort
Es wird ein globaler Adressraum verwendet
***** Add Reverse
Example entry that I cant push (also child of "MIMD Strukturen")
*** Distributed Memory :Distributed:
**** distributed memory, programmiermodell
:PROPERTIES:
:ANKI_NOTE_TYPE: SysProg Frage
:ANKI_FAILURE_REASON: Note creation failed for unknown reason
:END:
***** Frage
Was ist bei einer MIMD Architektur mit gemeinsamen Speicher das Programmiermodell?
***** Antwort
Es ist nachrichtenorientiert.
***** Add Reverse
Is there a way I can get more information? I have Anki Version 2.1.0beta29
installed, with AnkiConnect enabled.
Here is the full buffer that fails: https://gist.github.com/matthew-piziak/b96f8ace0c4f367498c7b30c2d256dae
My environment is the following.
/tmp$ uname -a
MINGW64_NT-6.1 JPC20316739 2.11.2(0.329/5/3) 2018-11-26 09:22 x86_64 Msys
(emacs-version)
"GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2019-02-25"
anki-editor Version: 0.3.3
and is in proxy.
/tmp$ cat anki-editor-note.org
* Idiom :vocab:idioms:
:PROPERTIES:
:ANKI_DECK: Default
:ANKI_NOTE_TYPE: Basic
:END:
** Front
(it's) raining cats and dogs
** Back
it's raining very hard
I open anki-editor-note.org file and set anki-editor-mode,
then execute M-x anki-editor-push-notes,
it fails and gets the following.
:ANKI_FAILURE_REASON: Error communicating with AnkiConnect using cURL: exited abnormally with code 43
Could you teach me what's is wrong? or teach where I put "--noproxy" option.
Absolutely curl with --noproxy option works with anki-connect
and able to push notes into Anki-web.
The following the results curl execution
/tmp$ cat anki-connect-note.json
{
"action": "addNote",
"version": 6,
"params": {
"note": {
"deckName": "Default",
"modelName": "Basic",
"fields": {
"Front": "front content",
"Back": "back content"
},
"options": {
"allowDuplicate": false
},
"tags": [
"yomichan"
],
"audio": {
"url": "https://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kanji=猫&kana=ねこ",
"filename": "yomichan_ねこ_猫.mp3",
"skipHash": "7e2c2f954ef6051373ba916f000168dc",
"fields": [
"Front"
]
}
}
}
}
/tmp$ curl --noproxy localhost localhost:8765 -X POST -d @anki-connect-note.json
{"result": 1551686026571, "error": null}
My version of anki is 2.1.13.
AnkiConnect has been reinstalled.
Here's the information about request.
My English is very poor, too.
[debug] REQUEST
[debug] Run: C:\tools\msys2\usr\bin\curl.exe --silent --include --location --compressed --cookie c:/Users/xx299/.emacs.d/.cache/request/curl-cookie-jar --cookie-jar c:/Users/xx299/.emacs.d/.cache/request/curl-cookie-jar --write-out \n(:num-redirects %{num_redirects} :url-effective %{url_effective}) --data-binary @c:/Users/xx299/AppData/Local/Temp/emacs-request4uGLZa --request POST http://127.0.0.1:8765
[debug] REQUEST--CURL-CALLBACK event = finished
[debug] REQUEST--CURL-CALLBACK proc = #<process request curl>
[debug] REQUEST--CURL-CALLBACK buffer = #<buffer *request curl*-167308>
[debug] REQUEST--CURL-CALLBACK symbol-status = nil
[debug] REQUEST--CALLBACK
[debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Type: text/json
Access-Control-Allow-Origin: *
Content-Length: 4
null
[debug] REQUEST-RESPONSE--CANCEL-TIMER
[debug] -CLEAN-HEADER
[debug] -CUT-HEADER
[debug] error-thrown = nil
[debug] -PARSE-DATA
[debug] parser = json-read
[debug] data = nil
[debug] symbol-status = success
[debug] Executing success callback.
#+PROPERTY: ANKI_DECK Default
* Fact
:PROPERTIES:
:ANKI_NOTE_TYPE: Cloze
:END:
** Text
Cards of this note wil be created in {{c1::Default::which deck ?}}
:ANKI_FAILURE_REASON: Error communicating with AnkiConnect using cURL: exited abnormally with code 52
Debug info:
Anki 2.1.0beta40 Python 3.6.2 Qt 5.9.2 PyQt 5.9
Platform: Linux
Flags: frz=True ao=True
Caught exception:
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 297, in advance
self.server.advance()
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 205, in advance
self.advanceClients()
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 220, in advanceClients
self.clients = list(filter(lambda c: c.advance(), self.clients))
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 220, in <lambda>
self.clients = list(filter(lambda c: c.advance(), self.clients))
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 127, in advance
self.writeBuff += self.handler(req)
File "/home/chenli/.local/share/Anki2/addons21/2055492159/__init__.py", line 239, in handlerWrapper
body = makeBytes(json.dumps(self.handler(params)))
File "json/__init__.py", line 231, in dumps
File "json/encoder.py", line 199, in encode
File "json/encoder.py", line 257, in iterencode
File "json/encoder.py", line 180, in default
<class 'TypeError'>: Object of type 'map' is not JSON serializable
Hello,
When I try to push my notes to anki, it gives me this error: "Symbol’s function definition is void: err". I see it's a definition problem, but I don't understand what "err" corresponds to.
Any help will be appreciated
Best,
Hugo
anki-editor-mode can no longer connect to AnkiConnect on the new version of anki. It works fine on anki2.0. Can someone else reproduce the problem?
https://github.com/louietan/anki-editor/blob/master/anki-editor.el#L550
(define-minor-mode anki-editor-mode
"anki-eidtor-mode"
:lighter " anki-editor"
(if anki-editor-mode (anki-editor-setup-minor-mode)
(anki-editor-teardown-minor-mode)))
Please change "anki-eidtor-mode" to "anki-editor-mode". "eidtor" appears only at that line of the file.
Hey there,
great package you wrote, I found it yesterday and have been
looking for something similiar for a long time already! :)
One of the first things I ran into was making cards containing
pseudocode. After a bit of searching I found the alltt
environment, which allows for code blocks which include math
symbols (To make alltt work in anki you can put the
\usepackage{alltt} into the cards latex header by going to
Tools/Manage Note Types/Options).
So at first everything worked great, however I sometimes got
errors, in my code blocks..
When you write something like:
\begin{alltt}
for i in \(\mathcal{M\sb{\epsilon}}\):
do something
\end{alltt}
everything just works fine. When I however have lines ending with
\) or \], I get latex errors in anki. The following for example does not
work:
\begin{alltt}
for i in \(\mathcal{M\sb{\epsilon}}\)
do something
\end{alltt}
In anki [/$] is created at the end of the line, but since there
is no opening [$], anki can't compile the generated latex code.
Also this happens inside the [latex] ... [/latex] region, where
it shouldn't replace \) with the anki specific notation, from what I
understand, since the whole region will be compiled as a whole
anyway.
I haven't looked at the code, but I guess at some point it
seems to replace \) and \] always, when they are at the end of a
line.
Oh also for anyone else who runs into this problem: if you insert a
whitespace behind the \), the line does not end with \) anymore and
everything will work fine in anki.
Really great package! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.