You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chinese Support Redux is a rewrite and port of the <ahref="https://github.com/ttempe/chinese-support-addon">original</a> Chinese Support add-on to Anki 2.1. It offers a number of features that streamline the process of creating flashcards for learning Chinese. The current focus of development effort is on improving the stability of the add-on and the accuracy of its output. Once the core functionality is sufficiently robust and reliable, additional features will be considered. While many of the changes will be structural in nature, I would encourage users to update the add-on whenever the version number increases and notify me of any problems. Your feedback is important.
5
+
Chinese Support Redux is an Anki 2.1-compatible rewrite of the <ahref="https://github.com/ttempe/chinese-support-addon">original</a> Chinese Support add-on. It offers a number of features that streamline the process of creating flashcards for learning Chinese. The current focus of development effort is on improving the stability of the add-on and the accuracy of its output. Once the core functionality is sufficiently robust and reliable, additional features will be considered.
5
6
6
-
<b>Important Note</b>: If you find that a field is not filling at all, please check <ahref="https://github.com/luoliyan/chinese-support-redux/blob/master/chinese/config.json">config.json</a> for the complete list of valid field names.
7
+
Please note that the add-on is still in beta and is sometimes shipped in an unstable state. Please upgrade with each new release and report any issues on GitHub. The automated test suite is a work-in-progress, so I still rely heavily on user reports to supplement my own manual testing.
8
+
9
+
<b>Important Notes</b>
10
+
11
+
<ul><li>If you find that a field is not filling at all, please check <ahref="https://github.com/luoliyan/chinese-support-redux/blob/master/chinese/config.json">config.json</a> for the complete list of valid field names. For those migrating from an older version of the add-on, you will need to rename any definition fields to <code>English</code>, <code>German</code> or <code>French</code>, depending on what you want.</li><li>If tone colours are not showing, ensure that the styling section of the template contains the following CSS:</li></ul>
12
+
<code>
13
+
.tone1 {color: red;}
14
+
.tone2 {color: orange;}
15
+
.tone3 {color: green;}
16
+
.tone4 {color: blue;}
17
+
.tone5 {color: gray;}
18
+
</code>
7
19
8
20
<b><i>Features</i></b>
9
21
10
-
<ul><li>Automatic field filling<ul><li>Translation (from built-in dictionary; supports English, German and French)</li><li>Romanisation (supports <ahref="https://en.wikipedia.org/wiki/Pinyin">Pīnyīn (拼音)</a> and Cantonese <ahref="https://en.wikipedia.org/wiki/Jyutping">Jyutping (粵拼)</a>)</li><li>Mandarin Audio (fetched from Google or Baidu)</li><li>Traditional (繁體字) and simplified (簡體字) characters</li><li><ahref="https://en.wikipedia.org/wiki/Bopomofo">Bopomofo (ㄅㄆㄇㄈ)</a>, also known as Zhuyin (注音)</li><li><ahref="https://www.w3schools.com/tags/tag_ruby.asp">Rubies</a> (small-print transcription placed above characters)</li><li>Frequency (from “very basic” to “obscure”). Based on <ahref="https://github.com/ernop/anki-chinese-word-frequency">anki-chinese-word-frequency</a></li></ul></li><li>Tone colours (applied to characters, romanisation and Bopomofo)</li><li>Built-in note types (Basic and Advanced)</li></ul>
22
+
<ul><li>Automatic field filling<ul><li>Translation (from built-in dictionary; supports English, German and French)</li><li>Romanisation (supports <ahref="https://en.wikipedia.org/wiki/Pinyin">Pīnyīn (拼音)</a> and Cantonese <ahref="https://en.wikipedia.org/wiki/Jyutping">Jyutping (粵拼)</a>)</li><li>Mandarin Audio (fetched from Google or Baidu)</li><li>Traditional (繁體字) and simplified (簡體字) characters</li><li><ahref="https://en.wikipedia.org/wiki/Bopomofo">Bopomofo (ㄅㄆㄇㄈ)</a>, also known as Zhuyin (注音)</li><li><ahref="https://www.w3schools.com/tags/tag_ruby.asp">Rubies</a> (small-print transcription placed above characters)</li><li>Frequency (from “very basic” to “obscure”) - based on <ahref="https://github.com/ernop/anki-chinese-word-frequency">anki-chinese-word-frequency</a></li><li>Usage Sentence Examples - Chinese/English sentence pairs from <ahref="https://tatoeba.org/">Tatoeba</a></li></ul></li><li>Tone colours (applied to characters, romanisation and Bopomofo)</li><li>Built-in note types (Basic and Advanced)</li></ul>
11
23
<b><i>Status</i></b>
12
24
13
25
The vast majority of features have been successfully ported, and the add-on is in a usable state, albeit with some definite rough edges.
@@ -20,7 +32,7 @@
20
32
21
33
<b><i>Usage</i></b>
22
34
23
-
The core feature of the add-on is the automatic field filling. To take advantage of this, you need to have an Anki note type with the appropriate fields (e.g., <code>Hanzi</code>, <code>Meaning</code>, <code>Reading</code>, <code>Sound</code>). See <code>config.json</code> for a list of valid field names.
35
+
The core feature of the add-on is the automatic field filling. To take advantage of this, you need to have an Anki note type with the appropriate fields (e.g., <code>Hanzi</code>, <code>English</code>, <code>Pinyin</code>, <code>Sound</code>). See <code>config.json</code> for a list of valid field names.
24
36
25
37
If you don't already have such a note type, the easiest approach is to use one of the built-in models. Two types are installed automatically: Basic and Advanced. The only important difference is that the Advanced model shows more information.
26
38
@@ -39,7 +51,9 @@
39
51
40
52
I understand the documentation is sparse. Anyone who wishes to add content to <ahref="https://github.com/luoliyan/chinese-support-redux/wiki">the wiki</a> is more than welcome to.
41
53
42
-
<b><i>Testing</i></b>
54
+
<b><i>Development</i></b>
55
+
56
+
<b>Testing</b>
43
57
44
58
For those who wish to run the tests locally, this is fairly straightforward.
45
59
@@ -64,3 +78,12 @@
64
78
pip install -r requirements.txt
65
79
make test
66
80
</code>
81
+
82
+
<b>Debugging with PyCharm</b>
83
+
84
+
<h4>(a) Without Anki Source</h4><ol><li>Copy the repo root to the Anki add-ons folder. As of version 2.1, this is <code>%AppData%\Anki2\addons21</code></li><li>Create a Python 3.8 virtual environment in PyCharm for the add-on folder (make sure you are running 64-bit Python). This can be done with:<code>pythonimport platformplatform.architecture()</code></li><li>Run the following in the PyCharm console (these could be added to <code>requirements.txt</code> instead):<code>pythonimport subprocesssubprocess.check_call(["pip3", "install", "mypy", "anki", "ankirspy", "aqt", "pyqt5", pyqtwebengine"])</code></li><li>Install the <code>requirements.txt</code> for the project venv</li><li>Create a file for debugging in PyCharm as:<code>pythonimport aqtaqt.run()</code></li><li>Start debugging. The first Anki run will pick up the <code>tests</code> folder as a plugin and error out. This is expected.</li><li>Go to the Tools → Add-ons menu and disable <code>tests</code></li><li>Enjoy coding!</li></ol>
85
+
<h4>(b) With Anki Source</h4><ol><li>Download and extract Anki source code somewhere on the hard drive.</li><li>Create a folder such as <code>anki-addon-dev</code> on your hard drive and open it on PyCharm as a project. Then, open Anki source code folder as another project within the current project window by choosing Attach.</li><li>Under <code>Preferences → Project → Project Dependencies → anki-addon-dev</code>, check the box to approve the add-on depends on Anki source code.</li><li>Under the run configurations beside run and debug buttons, edit the configuration as follows:</li><li>Script Path: <code>[PATH_TO_ANKI_SOURCE_FOLDER]/anki-2.1.13/runanki</code></li><li>Parameters: <code>-b [PATH_TO_ANKI_ADDON_PROJECT]/anki-addon-dev</code></li><li>Create your project files and do the development on this path:<code>anki-addon-dev/addons21/[YOUR_PROJECT_FOLDER]</code></li><li>Happy debugging while developing </li></ol>
86
+
<b>Additional Guidance</b>
87
+
88
+
<ul><li><ahref="https://addon-docs.ankiweb.net/#/getting-started">Writing Anki Add-ons - Getting Started</a></li><li><ahref="https://github.com/ankitects/anki/blob/main/docs/development.md">Anki development README</a></li><li><ahref="https://chrisk91.me/2018/02/13/Setting-up-VSCode-for-Anki-addon-development.html">Setting up VSCode for Anki add on development</a></li></ul>
Chinese Support Redux is an Anki 2.1-compatible rewrite of the [original](https://github.com/ttempe/chinese-support-addon) Chinese Support add-on. It offers a number of features that streamline the process of creating flashcards for learning Chinese. The current focus of development effort is on improving the stability of the add-on and the accuracy of its output. Once the core functionality is sufficiently robust and reliable, additional features will be considered.
9
9
10
10
Please note that the add-on is still in beta and is sometimes shipped in an unstable state. Please upgrade with each new release and report any issues on GitHub. The automated test suite is a work-in-progress, so I still rely heavily on user reports to supplement my own manual testing.
@@ -73,7 +73,9 @@ If you encounter any issues, the best way to have these addressed is to [raise t
73
73
74
74
I understand the documentation is sparse. Anyone who wishes to add content to [the wiki](https://github.com/luoliyan/chinese-support-redux/wiki) is more than welcome to.
75
75
76
-
## Testing
76
+
## Development
77
+
78
+
### Testing
77
79
78
80
For those who wish to run the tests locally, this is fairly straightforward.
4. Install the requirements.txt for the project venv
119
-
120
-
5. Create a filefor debugging in pycharm as:
119
+
4. Install the `requirements.txt`for the project venv
120
+
5. Create a filefor debugging in PyCharm as:
121
121
``` python
122
122
import aqt
123
-
124
123
aqt.run()
125
124
```
126
-
6. Start debugging. The first anki run will pick up the 'tests' folder as a plugin and error out. This is expected.
127
-
7. Go to the Tools->Add-ons menu and disable 'tests'
125
+
6. Start debugging. The first Anki run will pick up the `tests` folder as a plugin and error out. This is expected.
126
+
7. Go to the Tools → Add-ons menu and disable `tests`
128
127
8. Enjoy coding!
129
128
130
-
### With Anki Source
129
+
#### (b) With Anki Source
130
+
131
131
1. Download and extract Anki source code somewhere on the hard drive.
132
132
2. Create a folder such as`anki-addon-dev` on your hard drive andopen it on PyCharm as a project. Then, open Anki source code folder as another project within the current project window by choosing Attach.
133
-
3. On`Preferences -> Project -> Project Dependencies -> anki-addon-dev`: Check the box to approve the add-on depends on Anki source code.
134
-
4. Under the run configurations beside run and debug buttons, edit configurationsas follows:
0 commit comments