-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
116 lines (107 loc) · 3.37 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import genanki
fields = [
{'name': 'Question'},
{'name': 'Answer'},
{'name': 'Hint'},
]
fields_1 = [
{'name': 'Question'},
{'name': 'Kanji'},
{'name': 'Diagram'},
]
templates_1 = [
{
'name': 'Card 1',
'qfmt': 'English meaning <br> {{Question}} <br> <br> <br> {{hint:Hint}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Answer}}',
}]
templates_2 = [
{
'name': 'Card 1',
'qfmt': 'English meaning <br> {{Question}} <br> <br> <br> {{hint:Hint}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Answer}}',
}]
templates_3 = [
{
'name': 'Card 1',
'qfmt': 'Kanji <br> {{Question}} <br> <br> <br> {{hint:Hint}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Kanji}} <br> {{Diagram}}',
}]
templates_4 = [
{
'name': 'Card 1',
'qfmt': 'Kanji reading <br> {{Question}} <br> <br> <br> {{hint:Hint}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Answer}}',
}]
sound_card = genanki.Model(
160739111519,
'sound model',
fields=fields,
templates=templates_1,
css='''.card {
font-family: honyaji-re;
font-size: 40px;
text-align: center;
color: black;
background-color: white;
}
.jp { font-size: 35px }
.win .jp { font-family: "arial", "arial"; }
.mac .jp { font-family: "honyaji-re", "ヒラギノ明朝 Pro"; }
.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .jp { font-family: "Hiragino Mincho ProN"; }'''
)
kanji_to_english_card = genanki.Model(
160739118319,
'kanji model',
fields=fields,
templates=templates_2,
css='''.card {
font-family: honyaji-re;
font-size: 40px;
text-align: center;
color: black;
background-color: yellow;
}
.jp { font-size: 35px }
.win .jp { font-family: "arial", "arial"; }
.mac .jp { font-family: "honyaji-re", "ヒラギノ明朝 Pro"; }
.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .jp { font-family: "Hiragino Mincho ProN"; }'''
)
english_to_kanji = genanki.Model(
160739191319,
'Japanese_model',
fields=fields_1,
templates=templates_3,
css='''.card {
font-family: honyaji-re;
font-size: 40px;
text-align: center;
color: black;
background-color: Aqua;
}
.jp { font-size: 35px }
.win .jp { font-family: "arial", "arial"; }
.mac .jp { font-family: "honyaji-re", "ヒラギノ明朝 Pro"; }
.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .jp { font-family: "Hiragino Mincho ProN"; }'''
)
kanji_to_reading = genanki.Model(
1607391018319,
'kanji reading model',
fields=fields,
templates=templates_4,
css='''.card {
font-family: honyaji-re;
font-size: 40px;
text-align: center;
color: black;
background-color: LightCyan;
}
.jp { font-size: 35px }
.win .jp { font-family: "arial", "arial"; }
.mac .jp { font-family: "honyaji-re", "ヒラギノ明朝 Pro"; }
.linux .jp { font-family: "Kochi Mincho", "東風明朝"; }
.mobile .jp { font-family: "Hiragino Mincho ProN"; }'''
)