Skip to content

Commit

Permalink
Fix note type creation
Browse files Browse the repository at this point in the history
  • Loading branch information
glutanimate committed Mar 6, 2018
1 parent e26d1d9 commit b7f8ed1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/mouseover_dictionary/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,33 @@

from .config import CONFIG


fields = (
CONFIG["dictionaryTermFieldName"],
CONFIG["dictionaryDefinitionFieldName"]
)

# Default card template
card_front = """\
<b>Define</b>: {{%s}}\
""" % CONFIG["dictionaryTermFieldName"],
card_front = """
<b>Define</b>: {{%s}}
""" % CONFIG["dictionaryTermFieldName"]

card_back = """\
card_back = """
{{FrontSide}}
<hr id=answer>
{{%s}}\
{{%s}}
""" % CONFIG["dictionaryDefinitionFieldName"]

css = """\
css = """
.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}\
}
"""


Expand All @@ -47,10 +48,10 @@ def addModel(col):
def_model = models.new(CONFIG["dictionaryNoteTypeName"])
# Add fields:
for fname in fields:
fld = models.newField(fname)
models.addField(def_model, fld)
fld = models.newField(fname)
models.addField(def_model, fld)
# Add template
template = models.newTemplate(CONFIG["dictionaryDefinitionFieldName"])
template = models.newTemplate("Definition")
template['qfmt'] = card_front
template['afmt'] = card_back
def_model['css'] = css
Expand Down

0 comments on commit b7f8ed1

Please sign in to comment.