-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanki_note_model.py
More file actions
49 lines (44 loc) · 1.17 KB
/
anki_note_model.py
File metadata and controls
49 lines (44 loc) · 1.17 KB
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
from genanki import Model
# TODO Conditional formatting?
anki_note_model = Model(
1770821663,
'PY Sentence Mining Model',
fields=[
{'name': 'Word'},
{'name': 'LemmatizedWord'},
{'name': 'Sentence'},
{'name': 'Translation'},
{'name': 'Tag'},
{'name': 'Gender'},
{'name': 'MyMedia'},
],
templates=[
{
'name': 'Card PY GEN',
'qfmt': '<div id="french-word"><b>{{Word}}</b> {{LemmatizedWord}}</div><div id="sentence"><br />{{Sentence}}</div>{{MyMedia}}',
'afmt': '{{FrontSide}}<hr id="answer"><em id="tag">{{Tag}}</em> <b>{{Translation}}<b><div id="gender">{{Gender}}</div>'
}
],
css='''
.card {
padding: 1.5rem;
font-size: 2.2rem;
font-family: Arial;
text-align: center;
}
#answer {
margin: 1rem auto;
}
#sentence {
margin-bottom: 2.5rem;
}
#tag {
color:gray;
font-size: 1.1rem;
margin-right: 0.8rem;
}
#gender {
font-weight: normal;
}
'''
)