# Flashy **!!! The project is still in early development so expect breaking changes !!!** A flashcard TUI written in Rust that supports Anki styled repetition and writing flashcards in TOML. ## Features - Extensive **CLI** to manage decks, reviews and flashcards - **Terminal UI (TUI)** to review cards using [fsrs](https://github.com/open-spaced-repetition/fsrs-rs) spaced repetition - Write flashcards in _any_ config format - Currently available: **json and toml** but very easily extensible to formats that implement serde - Easy **import** and merge into existing cards - **Export** data into all supported config formats I used [fsrs](https://github.com/open-spaced-repetition/fsrs-rs) (SR scheduling), [ratatui](https://ratatui.rs/) (UI) and [clap](https://docs.rs/clap/latest/clap/) (CLI). ## Installation ```bash # clone this repo git clone https://gitlab.com/haasal/flashy-rs cd flashy-rs cargo run -- help ``` ## Usage This project consists of a CLI and a TUI. The CLI is used to import flashcard files, add new flashcards and start the UI. ### Adding cards through CLI ```bash cargo run -- new deck --name "my-deck" cargo run -- new flashcard --deck "my-deck" -q "Question..." -a "Answer..." cargo run -- new flashcard --deck "my-deck" -q "Question 2..." -a "Answer 2..." cargo run -- ui --deck "my-deck" # Start the TUI ``` ### Loading decks from config file Create file `my-cards.toml`: ```toml [[decks]] name = "Deck 1" [[decks.cards]] q = "Question 1" a = "Answer 1" [[decks.cards]] question = "Question 2" answer = "Answer 2" [[decks.cards]] q = "Question 4" a = "Answer 4" [[decks]] name = "Deck 2" description = "Description 2" [[decks.cards]] q = "Question 3" a = "Answer 3" ``` Import the deck into the database ```bash cargo run -- file --import -f "my-deck.toml" ``` Review cards in `Deck 1` ```bash cargo run -- ui --deck "Deck 1" ``` Make change to `my-config.toml` and reimport like above. Reviews are _not_ overwritten. ## Contributing I'm happy you want to contribute! PRs _and_ issues are **very welcome**. Please create an issue _before_ beginning to work on a PR so the changes can be discussed beforehand. Take a look at the `CONTRIBUTING.md` for more info. Please take a look at the **TODOs** below if you need inspiration ;) ## TODOs ### Chores/Fixes - [ ] Better logging (i.e. return deleted flashcards, ...) - [ ] Proper error messages instead of raw sql error - [ ] Log warnings on duplicate questions and upserts - [ ] Add delete flag for `file --import` so that decks are mapped 1:1 into db - [ ] Add tests... - [x] Use [this algo](https://github.com/open-spaced-repetition/fsrs-rs) for spaced repetition - [ ] More elegant way of displaying controls (directly coupled to actual controls or sth) - [ ] Only show due flashcards - [ ] Order flashcards by due date (due in front) - [ ] Cut down on the unfortunately massive amount of dependencies (mainly caused by missing feature flags in fsrs-rs) - [ ] [open issue](https://github.com/open-spaced-repetition/fsrs-rs/issues) - [ ] Move database to predefined config folder so one can run this outside the project directory - [ ] Create pipelines (CI/CD) - [ ] Specify development environment (clippy, formatting etc.) - [ ] Better documentation - [ ] Code cleanup and refactor - [ ] GitLab flags in readme (Crates.io etc.) ### Features - [ ] Ascii-math as UTF-8 support - [ ] More config formats - [ ] Write/Render flashcards in markdown - [ ] Create Flashcards in the ui - [ ] Integrate toggleable logging windows into Ui - [ ] Training fsrs-rs parameters - [ ] Remove rating from db - [ ] Colorize `easy`, `hard`, ... - [ ] Plugin support - [ ] Configuration options