Commit graph

9 commits

Author SHA1 Message Date
Damien Elmes
ddcf83bc7f add [] to cloze 2011-04-29 11:43:06 +09:00
Damien Elmes
f0909ebed2 if context is off, don't lose outer field styling 2011-04-28 09:24:03 +09:00
Damien Elmes
0fdb966766 wrap clozes in a classed span instead of bold 2011-04-28 09:24:03 +09:00
Damien Elmes
03d00228aa support stripping context of cloze 2011-04-28 09:24:03 +09:00
Damien Elmes
ed75e4bee2 refactor cloze deletions and text:field, add forecast
Previously cloze deletions were handled by copying the contents of one field
into another and applying transforms to it. This had a number of problems:
- after you add a card, you can't undo the cloze deletion
- if you spot a mistake, you have to edit it twice (or more if you have more
  than one cloze for a sentence)
- making multiple clozes requires copying & pasting the sentence multiple
  times
- this also lead to much bigger decks if the sentences being cloze-deleted are
  large
- related clozes can't be spaced apart as siblings

To address these issues, we introduce the idea of cloze tags in the card
template and fields. If the template has the text:

{{cloze:1:field}}

And a field has the following contents:

{{c1::hello}}

Then the template will automatically replace that part of the text with either
occluded text, or a highlighted answer. All other clozes in the field are
displayed normally.

At the same time, we add support for text: into the template library, instead
of manually creating text: fields in the dict for every field.

Finally, add a forecast routine to get the due counts for the next week, which
is used in the GUI.
2011-04-28 09:23:56 +09:00
Damien Elmes
0e08092f65 disable callable replacement which isn't supported on older pythons 2011-01-20 05:32:30 +09:00
Damien Elmes
cdcde2f2d3 fix unicode warning when invalid template message given 2011-01-13 19:43:38 +09:00
Damien Elmes
425789535f don't trim whitespace in sections 2010-12-20 00:37:16 +09:00
Damien Elmes
a5af8fb8e9 convert pystache to private library since it doesn't behave like upstream 2010-11-29 22:51:55 +09:00
Renamed from pystache/template.py (Browse further)