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

How to use “type” class? #16

Closed purequant closed 5 years ago

purequant commented 5 years ago

Thanks for developing the awesome addon. But if I want to write the line,like "type" class,how can i do that?

sobjornstad commented 5 years ago

Sorry, I don't quite understand what you're asking. Could you give an example?

purequant commented 5 years ago

Oh,sorry,my English is poor. I want to use the “type” function,so I changed the template like this,but it can't work.

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

<br>

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

image Is there any way to do this?

sobjornstad commented 5 years ago

Ah, that makes sense now.

As described in the manual, you have to have a field with type: on it on both the front and the back of your cards for this feature to work. In your example, you've only put it on the back, so Anki doesn't know where to put the field you type your answer into on the front of the card, and consequently there's nothing to compare the correct answer with.

On your front template, try replacing

<span class="cloze">[...]</span>

with

{{type:Line}}

Does that accomplish what you want? In a quick test, this seemed to work for me.

purequant commented 5 years ago

Oh,how stupid I am.It also can work in my computer,thank you very much.