hascard 0.3.0.0 → 0.3.0.1
raw patch · 5 files changed
+33/−9 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−0
- README.md +24/−7
- hascard.cabal +2/−2
- src/Recents.hs +1/−0
- src/UI/Cards.hs +1/−0
ChangeLog.md view
@@ -1,4 +1,9 @@ # Changelog for hascard+## 0.3.0.1+Fixed bugs:+- Crash on empty recents list+- Crash on any key other than Enter at FinalPopup+ ## 0.3.0.0 New: - When reviewing a deck, the amount of correctly and incorrectly answered cards are now displayed.
README.md view
@@ -1,11 +1,13 @@ # hascard-[](https://travis-ci.org/Yvee1/hascard) [](https://hackage.haskell.org/package/hascard) [](https://github.com/Yvee1/hascard/releases)+[](https://travis-ci.org/Yvee1/hascard) [](https://github.com/Yvee1/hascard/releases) [](https://aur.archlinux.org/packages/hascard/) [](https://hackage.haskell.org/package/hascard) A minimal commandline utility for reviewing notes. 'Flashcards' can be written in markdown-like syntax. -+<p align="center">+<img alt="a recording of example usage of the hascard application" src="./recordings/recording.gif">+</p> ## Contents - [Installation](#installation)@@ -31,6 +33,9 @@ ### 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. +### Arch Linux+Thanks to [loki7990](https://github.com/loki7990), hascard is also on the AUR: https://aur.archlinux.org/packages/hascard/.+ ### Snapcraft Hascard is also on [snapcraft](https://snapcraft.io/hascard). Installation instructions are on that site. If you already have snap installed you can just install hascard via `sudo snap install hascard`. By default snap applications are isolated from the system and run in a sandbox. This means that hascard does not have permission to read or write any files on the system aside from those under `%HOME/snap/hascard`. To be able to read cards also in other directories under the home directory, hascard makes use of the `home` interface which might need to be enabled manually using `sudo snap connect hascard:home :home`. @@ -70,7 +75,9 @@ Explanation or definition of this word, or the answer to the question. ``` will result in-+<p align="center">+ <img src="./recordings/definition.gif"></img>+</p> ### Multiple choice This is a typical multiple choice question. The question starts with a `#` and the choices follow. Only one answer is correct, and is indicated by a `*`, the other questions are preceded by a `-`. As an example, the following text@@ -84,7 +91,9 @@ ``` gets rendered as-+<p align="center">+ <img src="./recordings/multiple-choice.gif"></img>+</p> ### Multiple answer Multiple choice questions with multiple possible answers is also possible. Here again the question starts with `#` and the options follow. Preceding each option is a box `[ ]` that is filled with a `*` or a `x` if it is correct. For example@@ -97,7 +106,10 @@ [ ] Option 4 ``` results in-+<p align="center">+ <img src="./recordings/multiple-answer.gif"></img>+</p>+ ### Open question Open questions are also supported. The words that have to be filled in should be surrounded by underscores `_`. Underscores can also be escaped by `\_` if they are part of the text, like is done in [`cards/analysis3.txt`](https://github.com/Yvee1/hascard/blob/48b5c0751ac72df791402b88c033e05488c9350d/cards/analysis3.txt#L34-L37t). Multiple answer possibilities can also be given by seperating them with vertical bars `|`. As an example, the card@@ -107,8 +119,11 @@ The symbol € is for the currency named _Euro_, and is used in the _EU|European Union_. ``` behaves like this- +<p align="center">+ <img src="./recordings/gapped-question.gif"></img>+</p>+ ### Reorder question This is a question where you have to put the elements in the correct order. Each element is preceded by a number indicating their correct place. The elements are rendered in the same order as they are written. For example the card @@ -120,7 +135,9 @@ 3. s ``` will look like-+<p align="center">+ <img src="./recordings/reordering.gif"></img>+</p> ## Miscellaneous info Written in Haskell, UI built with [brick](https://github.com/jtdaugherty/brick) and parsing of cards done with [parsec](https://github.com/haskell/parsec). Recordings of the terminal were made using [terminalizer](https://github.com/faressoft/terminalizer). The filebrowser widget was mostly copied from the brick [filebrowser demo program](https://github.com/jtdaugherty/brick/blob/master/programs/FileBrowserDemo.hs). Homebrew and Travis configurations were made much easier by [the tutorial from Chris Penner](https://chrispenner.ca/posts/homebrew-haskell).
hascard.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 37f6ac9df04a4bff9b2328a1faf264f14723a098a8f2c51b8d8a7f551eba0bb5+-- hash: ec2242b52f0e3c490e1e95ddd3da740967817bae67d755d08d1c2182b071abd2 name: hascard-version: 0.3.0.0+version: 0.3.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/Recents.hs view
@@ -69,6 +69,7 @@ in (x:xs', y) prep :: [FilePath] -> ([String], [FilePath])+prep [] = ([], []) prep fps@(fp:_) = if all ((== takeExtension fp) . takeExtension) fps then unzip (map ((\(pre, fn) -> (pre, dropExtension fn)) . splitFileName) fps) else unzip (map splitFileName fps)
src/UI/Cards.hs view
@@ -486,6 +486,7 @@ initialState = FinalPopup eventHandler gs s (V.EvKey V.KEnter []) = halt' gs+ eventHandler gs _ _ = continue gs deckMakerPopup :: Popup CS deckMakerPopup = Popup drawer eventHandler initialState