hascard 0.6.0.0 → 0.6.0.1
raw patch · 5 files changed
+27/−19 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +7/−3
- README.md +7/−3
- hascard.cabal +1/−1
- src/UI/Cards.hs +10/−10
- src/UI/Info.hs +2/−2
ChangeLog.md view
@@ -1,11 +1,15 @@ # Changelog for hascard +## 0.6.0.1 +Fixes: +- Change key for showing answer to open questions from F1 to Shift+Tab, which should cause fewer conflicts with existing keybindings (issue #31). + ## 0.6.0.0 New: - Windows support. -- `export` CLI command for exporting hascard cards to delimited text files. -- Possibility to vertically scroll flashcards if they are long enough. +- `export` CLI command for exporting hascard cards to delimited text files (issue #33). +- Possibility to vertically scroll flashcards if they are long enough (issue #25). - Scrollbars for menus where scrolling is possible, which can be controlled by mouse if the terminal supports this. -- Setting for shuffling answers to multiple choice/answer questions. +- Setting for shuffling answers to multiple choice/answer questions (issue #19). Fixes: - Improved navigation of parameter selection menu.
README.md view
@@ -25,7 +25,7 @@ - [Miscellaneous info](#miscellaneous-info) ## Installation -Installation on Windows is not possible sadly, aside from WSL. This is because hascard depends on vty which only supports UNIX-like operating systems (this includes macOS). +Windows, Linux and macOS are supported. ### Homebrew (for macOS) For macOS users an installation using homebrew is provided via a custom tap. You can run @@ -35,7 +35,7 @@ ``` ### Binary -Ubuntu and macOS binaries are available under [releases](https://github.com/Yvee1/hascard/releases/). To be able to run it from any directory, it has to be added to the PATH. This can be done by copying it to e.g. the `/usr/local/bin` directory. +Ubuntu, macOS, and Windows binaries are available under [releases](https://github.com/Yvee1/hascard/releases/). To be able to run it from any directory, it has to be added to the PATH. In Linux, this can be achieved, for example, by copying it to the `/usr/local/bin` directory. ### Arch Linux Thanks to [loki7990](https://github.com/loki7990), hascard is also on the AUR: https://aur.archlinux.org/packages/hascard/. @@ -59,7 +59,7 @@ After finishing a deck, there is an option to create new decks from the correctly answered or incorrectly answered cards, or both. The correct cards of a file named `deck.txt` are stored in `deck+.txt` in the same folder, and the incorrect ones in the file `deck-.txt`. Make sure you do not have files of those names that you want to keep since these _will_ be overwritten. ### CLI -The CLI provides two commands, `run` and `import`. The `hascard run` is essentially the same as just `hascard`, but the `run` command can be given a file to run the application on directly. When run on a file directly, parameters like whether to shuffle the deck are specified via CLI options instead of in a menu. +The CLI provides three commands, `run`, `import`, `export`. The `hascard run` command is essentially the same as just `hascard`, but the `run` command can be given a file to run the application on directly. When run on a file directly, parameters like whether to shuffle the deck are specified via CLI options instead of in a menu. As an example, say you have a file `deck.txt` with lots of cards in it and you want to review 5 random ones, you can use `hascard run deck -s -a 5`. Here `-s` shuffles the deck and `-a 5` specifies we only want to look at 5 of them. For more info, see `hascard run --help`. @@ -82,6 +82,10 @@ _de même_ ``` with the command `hascard import input.txt output.txt -r`. More info can be found in the help text at `hascard import --help`. + +#### Exporting decks +Similarly, one may want to convert hascard cards to delimited text files for use in other applications. +This functionality is provided by `hascard export`. For more info, see `hascard export --help`. ## Cards Decks of cards are written in `.txt` or `.md` files. A deck contains multiple cards which are seperated with a line containing three dashes `---`. For examples, see the [`/cards`](https://github.com/Yvee1/hascard/tree/master/cards) directory.
hascard.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hascard-version: 0.6.0.0+version: 0.6.0.1 synopsis: A TUI for reviewing notes using 'flashcards' written with markdown-like syntax. description: Hascard is a text-based user interface for reviewing notes using flashcards. Cards are written in markdown-like syntax. Please see the README file on GitHub at <https://github.com/Yvee1/hascard#readme> for more information. category: Application
src/UI/Cards.hs view
@@ -41,12 +41,12 @@ drawInfo :: CS -> Widget Name drawInfo s = if not (s ^. showControls) then emptyWidget else - strWrap . ("ESC: quit" <>) $ case s ^. cardState of - DefinitionState {} -> ", ENTER: flip card / continue" - MultipleChoiceState {} -> ", ENTER: submit answer / continue" - MultipleAnswerState {} -> ", ENTER: select / continue, c: submit selection" - OpenQuestionState {} -> ", LEFT/RIGHT/TAB: navigate gaps, ENTER: submit answer / continue, Ctrl+F1: show answer" - ReorderState {} -> ", ENTER: grab, c: submit answer" + strWrap . ("Esc: quit" <>) $ case s ^. cardState of + DefinitionState {} -> ", Enter: flip card / continue" + MultipleChoiceState {} -> ", Enter: submit answer / continue" + MultipleAnswerState {} -> ", Enter: select / continue, c: submit selection" + OpenQuestionState {} -> ", Left/Right/Tab: navigate gaps, Enter: submit answer / continue, Shift+Tab: show answer" + ReorderState {} -> ", Enter: grab, c: submit answer" drawCardBox :: Widget Name -> Widget Name drawCardBox w = C.center $ @@ -360,7 +360,7 @@ (OpenQuestionState {_highlighted = i, _number = n, _gapInput = kvs, _correctGaps = cGaps, _failed=fail}, OpenQuestion _ _ perforated) -> case ev of - V.EvKey (V.KFun 1) [V.MCtrl] -> zoom (cs.cardState) $ do + V.EvKey (V.KChar '\t') [V.MShift] -> zoom (cs.cardState) $ do gapInput .= correctAnswers entered .= True failed .= True @@ -391,7 +391,7 @@ V.EvKey (V.KChar c) [] -> zoom (cs.cardState) $ do unless frozen $ gapInput.at i.non "" %= (++[c]) - case c of + when frozen $ case c of 'k' -> up 'j' -> down _ -> return () @@ -425,8 +425,8 @@ _ -> return () where frozen = M.foldr (&&) True cGaps - down = when frozen $ scroll s 1 - up = when frozen $ scroll s (-1) + down = scroll s 1 + up = scroll s (-1) (ReorderState {_highlighted = i, _entered = submitted, _grabbed=dragging, _number = n, _order = kvs }, Reorder _ _ elts) -> case ev of
src/UI/Info.hs view
@@ -63,10 +63,10 @@ , "" , " * Enter confirms a selection, flips a card or continues to the next card" , "" - , " * Use TAB or the arrow keys for navigating gaps in open questions" + , " * Use Tab or the arrow keys for navigating gaps in open questions" , "" , " * Use the c key for confirming reorder questions or multiple choice questions with more than 1 possible answer" , "" - , " * Use Ctrl+F1 to show the answers of a open question" + , " * Use Shift+Tab to show the answers of a open question" , "" , " * Use Ctrl+Left and Ctrl+Right to move to previous and next cards without having to answer them; this is disabled in review mode"]