Small tool to preview Anki templates.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test_files/test1
.gitignore
.travis.yml
license.txt
previewtemplate.py
readme.md
requirements.txt
test_cli.sh
test_units.py

readme.md

Anki Template Tester

Overview over my Anki add-ons

Small tool to preview templates for the spaced repetition flashcard program Anki. When writing templatex, the built in template editor of Anki can become quite cumbersome. On the other hand one cannot just preview the card templates in the webbrowser due to the Anki specific elements (filling of the field values, conditional statements).

This small script takes a template (and a CSS style sheet) together with a file which contains some exemplary field values and gives back a HTML file which can be properly viewed in the browser.

Branch Description Travis
master (Hopefully) stable release Build Status
development Work on new features in progress. Might be completely broken from time to time. Build Status

Installation

All that is needed is the stand alone file previewtemplate.py and a python3 installation. If your python version is earlier than 3.4, please install the typing module, e.g. via sudo pip3 install typing.

Usage

$ python3 previewtemplate.py --help
usage: previewtemplate.py [-h] [-s STYLE] [-o OUTPUT] template fields

Test Anki templates, i.e. fill in field values and CSS to get a HTML file that
can be displayed in the web browser.

positional arguments:
  template              The HTML template
  fields                python file with dictionary containing field values

optional arguments:
  -h, --help            show this help message and exit
  -s STYLE, --style STYLE
                        Include CSS style sheet
  -o OUTPUT, --output OUTPUT
                        Output HTML file

License

MIT license. See file license.txt enclosed in the repository.