Bỏ qua đến nội dung

text editor for Latex, the selection or html source (FORK)

Chờ xử lý #anki #addon #text #editor #for #latex #the
https://forums.ankiweb.net/t/selection-to-external-text-editor-external-editor-fork-official-thread/
25/7/2020

Cách tải addon text editor for Latex, the selection or html source (FORK)

Bạn có thể tải addon bằng một trong hai cách sau:

Click nút Copy bên dưới để copy code vào clipboard

1184418999

Sau đó mở Anki → Tools → Add-ons → Get Add-ons → Dán code → OK

Mở trang addon trên AnkiWeb và tìm mã code ở cuối trang

Mở trên AnkiWeb

Cuộn xuống cuối trang AnkiWeb, tìm dòng có mã code 1184418999 và copy

3

Mô tả chi tiết

This is a fork of the add-on External Editor. I use the version from 2020-03-06 which works great in linux for me but I besides editing the html source I also wanted to just send the selection to an external editor as plain text. The default shortcut to save back the edited text into Anki is “Ctrl+Shift+F6”, to just send the text it’s “Ctrl+F6”. You can adjust these in the add-on config.

If you don’t need my additions you should use the original version of the add-on. My add-on has more code and more code means a higher chance to run into a bug.

You must probably adjust the config for your computer and adjust the path of the editor and command line arguments needed. How you do this depends on your operating system.

When I use the option to re-insert the content of the temporary file back into the anki editor it’s exactly at the same position. So if you had some prior formatting the reinserted text will have it applied, too. If your selected text contained closing tags these will have been removed. Example: You have <​b>Hallo<​/b>World. You select “lo Wor” and edit it to “TEST” then afterwards you’ll have <​b>HalTESTld which is invalid html because there’s no closing b tag. In my Anki 2.1.28 Anki automatically adds a closing b tag. So don’t mindlessly use this add-on on all kinds of selections. This could be useful if you are editing latex or have one of the markdown add-ons.

You can also just send the text without ever getting it back into the Anki editor (default shortcut “Ctrl+F6”) Some of my cards have code snippets. Sometimes I want to tweak them and run modified versions. And maybe I’ll make cards with code that needs to be fixed or completed in the future. So far I copied this code and manually opened my text editor with a new/temporary file and then pasted my selection.

Limitations

I don’t have a Mac so this add-on was not tested on MacOS. So you’ll probably run into an error on MacOS that I can’t fix. Code contributions are welcome. Use it at your own risk.


Screenshots


Liên kết hỗ trợ


Reviews (3)

👍 2020-09-11

I’m running a problem when using Ctrl+Shift+X, that sends the content of the field to VSCode. When there is an image which name has spaces or special characters, when I save in VSCode, the file name is corrupted when it returns to Anki (spaces turn into %25, for example, and Anki doesn’t recognize it). Is there a way of preventing this? Comment from author Hhmmm, at the moment I can’t reproduce this problem on my computer: I tried with spaces, apostrophes, and an acute accent.

I suggest we co

👍 2020-08-03

More detailed instructions on how to set up a custom text editor would be greatly appreciated. I managed to use only one of the two shortcuts (Ctrl+Shift+F6) by changing the line

“editor blocking”: “code”,

to

“editor blocking”: “/usr/bin/subl”,

which opens the selected text in Sublime Text 3 for Debian Buster and saves changes back to anki. Computer illiterate people like me need more hand-holding.

The addon is great though.

👍 2020-07-26

Nice iteration, great screencast.