Update HTML formatting to make example more realistic.
--- a/obsolete/exp_anki.py Sat Nov 12 00:19:34 2016 +0200
+++ b/obsolete/exp_anki.py Sat Nov 12 00:21:48 2016 +0200
@@ -61,11 +61,11 @@
tmpl = collection.models.newTemplate('en -> ru')
tmpl['qfmt'] = '<div class="from">{{en}}</div>'
-tmpl['afmt'] = '{{FrontSide}}\n\n<hr id=answer>\n\n{{ru}}'
+tmpl['afmt'] = '{{FrontSide}}<hr id=answer>{{ru}}'
collection.models.addTemplate(model, tmpl)
tmpl = collection.models.newTemplate('ru -> en')
tmpl['qfmt'] = '{{ru}}'
-tmpl['afmt'] = '{{FrontSide}}\n\n<hr id=answer>\n\n<div class="from">{{en}}</div>'
+tmpl['afmt'] = '{{FrontSide}}<hr id=answer><div class="from">{{en}}</div>'
collection.models.addTemplate(model, tmpl)
# print(dir(model))
@@ -89,14 +89,14 @@
note['en'] = "hello"
-note['ru'] = u"[heləʊ]\nint. привет"
+note['ru'] = u"[heləʊ] int. привет"
note.guid = "enru_1"
collection.addNote(note)
# print(dir(note))
note = collection.newNote()
note['en'] = "bye"
-note['ru'] = u"[baɪ]\nint. пока"
+note['ru'] = u"[baɪ] int. пока"
note.guid = "enru_2"
collection.addNote(note)
@@ -125,7 +125,7 @@
collection.models.addField(model_irrverb, collection.models.newField('v2'))
collection.models.addField(model_irrverb, collection.models.newField('v3'))
-ANSWER_MSG = '{{FrontSide}}<hr id=answer>{{v1}}\n{{v2}}\n{{v3}}'
+ANSWER_MSG = '{{FrontSide}}<hr id=answer>{{v1}}<br>{{v2}}<br>{{v3}}'
tmpl = collection.models.newTemplate('v1')
tmpl['qfmt'] = '<div class="v1">{{v1}}</div>'
tmpl['afmt'] = ANSWER_MSG