sobjornstad / AnkiLPCG

Addon for dae/anki for studying lyrics and poetry
https://ankilpcg.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
155 stars 22 forks source link

Add an option to make the cards type-in #32

Open jthulhu opened 2 years ago

jthulhu commented 2 years ago

Sometimes, especially when the spelling of certain rare words is hard, it would be neat to be able to have a type-in like card instead of simply revealing the answer. One way to implement this would be to add an option during the generation of the notes to make the whole poem "type-in", and to have a second note-type roughly equal to the current one, but with type-in in the template. I currently do this by hand, and the only limitation I see is that it's impossible to have multiple lines with type-in.

popyoung commented 4 days ago

You could simply modify the card template to implement this.

Front:

<div class="title">{{Title}} {{Sequence}}</div>
{{#Author}}<div class="author">{{Author}}</div>{{/Author}}

<br>
<div class="lines">
    {{Context}}
    <div class="cloze">
        {{#Prompt}}{{Prompt}}{{type:Line}}{{/Prompt}}
        {{^Prompt}}{{type:Line}}{{/Prompt}}
    </div>
</div>

Back:

<div class="title">{{Title}} {{Sequence}}</div>
{{#Author}}<div class="author">{{Author}}</div>{{/Author}}

<br>

<div class="lines">
    {{Context}}
    <div class="cloze">{{type:Line}}</div>
</div>

But the end token will cause a small flaw. image