Documentation
¶
Index ¶
- Variables
- func OsInit()
- func WriteConfig(config Config)
- type AllPersistedResults
- type Book
- type Catalog
- type Category
- type Config
- type ConfigView
- type ConfigViewSelection
- type EmbededWordList
- type Entry
- type Finder
- type Home
- type Layout
- type LayoutFile
- type LocalConfig
- type MainMenu
- type MainMenuSelection
- type NumericSetting
- type PersistentResults
- type PersistentResultsNode
- type ProgressView
- type ProgressViewSelection
- type Results
- type ResultsIdentifier
- type SentenceCountBasedTest
- type SentenceCountBasedTestSettings
- type SentenceCountTestResults
- type State
- type StringStyle
- type Styles
- type TestBase
- type TestSettingCursors
- type TestType
- type TimerBasedTest
- type TimerBasedTestResults
- type TimerBasedTestSettings
- type Toggleable
- type WordCountBasedTest
- type WordCountBasedTestSettings
- type WordCountTestResults
- type WordList
- type WordListName
- type WordListSelection
- type WordsSelection
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" RootCmd = &cobra.Command{ Use: "typedeck", Long: "typedeck — typioca with a memory: it keeps every key and drills your weak spots", RunE: func(cmd *cobra.Command, args []string) error { if showVersion { fmt.Println("typedeck ", Version) return nil } else { termenv.SetWindowTitle("typedeck") defer println("bye!") termWidth, termHeight, _ := term.GetSize(int(os.Stdin.Fd())) p := tea.NewProgram( initialModel( termenv.ColorProfile(), nil, termWidth, termHeight, ), tea.WithAltScreen(), ) _, err := p.Run() return err } }, } )
Functions ¶
func WriteConfig ¶
func WriteConfig(config Config)
Types ¶
type AllPersistedResults ¶
type AllPersistedResults = map[TestType]map[NumericSetting]map[WordListName][]PersistentResultsNode
type Book ¶
type Book struct {
Title string
Author string
Slug string
Source string
Chars int // runes in the cleaned text
Pos int // the bookmark: next rune to type
Laps int // times finished
Runs int
Typed int // characters typed in this book, all laps
Started int64 // unix seconds of the import
Last int64 // unix seconds of the last run in it: the home screen offers that book first
}
func ImportBook ¶
ImportBook reads src (file, URL or Gutenberg number) and stores the cleaned book. Importing a book again refreshes its text and keeps the bookmark. start, when given, is a phrase of the text: everything before its first appearance (title page, contents, preface) is left out.
type Catalog ¶
type Catalog struct {
Cats []string // Gutenberg's "Category:" shelves, sorted by name
Entries []Entry // ranked books first in rank order, then everything else by title
Fetched time.Time
}
func FetchCatalog ¶
FetchCatalog downloads both files, parses them and saves the compact form.
func LoadCatalog ¶
LoadCatalog: the saved copy while it is fresh, otherwise a download. A stale copy still serves when the download fails (the deck's WiFi is not to be trusted).
type Category ¶
type Category int
Category: two pseudo-categories in front of Gutenberg's own shelves.
type Config ¶
type Config struct {
TestSettingCursors TestSettingCursors
EmbededWordLists []EmbededWordList
WordLists []WordList
LayoutFiles []LayoutFile
Layout Layout
Version int
}
func ReadConfig ¶
func ReadConfig() Config
type ConfigView ¶
type ConfigView struct {
// contains filtered or unexported fields
}
type ConfigViewSelection ¶
type ConfigViewSelection struct{}
func (ConfigViewSelection) Enabled ¶
func (s ConfigViewSelection) Enabled() bool
type EmbededWordList ¶
type LayoutFile ¶
type LocalConfig ¶
type LocalConfig struct {
Words []WordList
}
type MainMenuSelection ¶
type MainMenuSelection interface {
Enabled() bool
// contains filtered or unexported methods
}
type NumericSetting ¶
type NumericSetting = int
type PersistentResults ¶
type PersistentResults struct {
Results AllPersistedResults
Version int
}
func PersistResults ¶
func PersistResults(results Results) PersistentResults
type PersistentResultsNode ¶
type PersistentResultsNode struct {
Wpm int
Accuracy float64
DeltaWpm float64
RawWpm int
Cpm int
WpmEachSecond []float64
}
func ReadResults ¶
func ReadResults(i ResultsIdentifier) []PersistentResultsNode
type ProgressView ¶
type ProgressView struct {
// contains filtered or unexported fields
}
type ProgressViewSelection ¶
type ProgressViewSelection struct{}
func (ProgressViewSelection) Enabled ¶
func (s ProgressViewSelection) Enabled() bool
type ResultsIdentifier ¶
type ResultsIdentifier struct {
// contains filtered or unexported fields
}
type SentenceCountBasedTest ¶
type SentenceCountBasedTest struct {
// contains filtered or unexported fields
}
type SentenceCountBasedTestSettings ¶
type SentenceCountBasedTestSettings struct {
// contains filtered or unexported fields
}
func (SentenceCountBasedTestSettings) Enabled ¶
func (s SentenceCountBasedTestSettings) Enabled() bool
type SentenceCountTestResults ¶
type SentenceCountTestResults struct {
// contains filtered or unexported fields
}
type StringStyle ¶
type TestSettingCursors ¶
type TimerBasedTest ¶
type TimerBasedTest struct {
// contains filtered or unexported fields
}
type TimerBasedTestResults ¶
type TimerBasedTestResults struct {
// contains filtered or unexported fields
}
type TimerBasedTestSettings ¶
type TimerBasedTestSettings struct {
// contains filtered or unexported fields
}
func (TimerBasedTestSettings) Enabled ¶
func (s TimerBasedTestSettings) Enabled() bool
type Toggleable ¶
type Toggleable interface {
// contains filtered or unexported methods
}
type WordCountBasedTest ¶
type WordCountBasedTest struct {
// contains filtered or unexported fields
}
type WordCountBasedTestSettings ¶
type WordCountBasedTestSettings struct {
// contains filtered or unexported fields
}
func (WordCountBasedTestSettings) Enabled ¶
func (s WordCountBasedTestSettings) Enabled() bool
type WordCountTestResults ¶
type WordCountTestResults struct {
// contains filtered or unexported fields
}
type WordListName ¶
type WordListName = string
type WordListSelection ¶
type WordListSelection struct {
// contains filtered or unexported fields
}
type WordsSelection ¶
type WordsSelection struct {
// contains filtered or unexported fields
}
todo: clean these up. Maybe we could reuse filtering by enabled and synce, because now it's redundant