anki

package
v0.0.0-...-7a09d4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package anki is the model handler for the Anki models.

Index

Constants

View Source
const (
	QuestionFace = iota
	AnswerFace
)

The possible faces of an Anki card

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic struct{}

Basic is the controller for the Anki Basic model

func (*Basic) Action

func (m *Basic) Action(card *model.Card, face *int, startTime time.Time, payload interface{}) (bool, error)

Action responds to a card action, such as a button press

func (*Basic) Buttons

func (m *Basic) Buttons(card *model.Card, face int) (studyview.ButtonMap, error)

Buttons returns the initial button state

func (*Basic) FuncMap

func (m *Basic) FuncMap(_ *model.Card, _ int) template.FuncMap

FuncMap returns a function map for Basic templates.

func (*Basic) IframeScript

func (m *Basic) IframeScript() []byte

IframeScript returns JavaScript to run inside the iframe.

func (*Basic) Type

func (m *Basic) Type() string

Type returns the string "anki-basic", to identify this model handler's type.

type Cloze

type Cloze struct {
	*Basic
}

Cloze is the controller for the Anki Cloze model.

func (*Cloze) FuncMap

func (m *Cloze) FuncMap(card *model.Card, face int) template.FuncMap

FuncMap returns a function map for Cloze templates.

func (*Cloze) Type

func (m *Cloze) Type() string

Type returns the string "anki-cloze", to identify this model handler's type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL