Documentation
¶
Index ¶
Constants ¶
View Source
const ( SHUFFLE_MODE_KEY = "shuffle" LAST_REVIEW_MODE_KEY = "lastreview" CREATED_AT_MODE_KEY = "createdat" LINEAR_MODE_KEY = "linear" )
View Source
const ( Reset = "\033[0m" Yellow = "\033[33m" ClearLine = "\033[K" // Wipes out old text to prevent text ghosting )
View Source
const (
BASIC_RENDERER = "basic"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginManifest ¶
type PluginManifest struct {
Name string `toml:"name"`
Alias string `toml:"alias,omitempty"`
Version string `toml:"version"`
Author string `toml:"author"`
Description string `toml:"description"`
Executable string `toml:"executable"`
Capabilities struct {
ReviewProcessor bool `toml:"review_processor"`
Renderer bool `toml:"renderer"`
UpdateCard bool `toml:"update_card"`
} `toml:"capabilities"`
}
PluginManifest represents the structured data required inside every plugin.toml file
func FindCapabilityPlugins ¶
FindCapabilityPlugins searches the plugins directory and finds all matching plugins of the same capability
func FindPlugin ¶
FindPlugin searches plugins directory for the first plugin that matches name and capability
type Renderer ¶
type Renderer interface {
Render(ctx context.Context, card database.Flashcard, cardNum int, cardCount int, modifiers []string) (string, string, string, error)
Init(ctx context.Context) (string, string, string, error)
}
///////////////////////////////////////////////////////////// Renderer {{{
type ReviewProcessor ¶
type ReviewProcessor interface {
Process(ctx context.Context, dbCards []database.Flashcard, modifiers []string) ([]database.Flashcard, error)
}
///////////////////////////////////////////////////////////// ReviewProcessor {{{
func DispenseReviewProcessor ¶
func DispenseReviewProcessor(a *app.App, mode string) (ReviewProcessor, func(), error)
type UpdateCard ¶
type UpdateCard interface {
UserPrompts(ctx context.Context, card database.Flashcard) ([]string, error)
Process(ctx context.Context, pluginName string, card database.Flashcard, userResponse string, promptIdx int, filters map[string]string, modifiers []string) (database.Flashcard, bool, string, error)
}
///////////////////////////////////////////////////////////// UpdateCard Capability {{{
type UpdateCardCollection ¶
type UpdateCardCollection struct {
// contains filtered or unexported fields
}
UpdateCardCollection holds a slice of UpdateCard structs and offers a run function that runs them all sequentially
func DispenseUpdateCard ¶
func DispenseUpdateCard(a *app.App) (UpdateCardCollection, func(), error)
Click to show internal directories.
Click to hide internal directories.