diff --git a/README.md b/README.md index 75079f3..c7af8a0 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ To pause the test, simply press ``. To resume, press `'e'` again. Your WPM (words per minute) score is calculated based on the number of typed characters divided by 5 (word), and normalized to a 60-second timeframe (minute). - > Note: So far it was only tested on `MacOS`. > Needs testing on `Linux` > No support for `Windows` yet (different file paths) @@ -33,12 +32,13 @@ Then to run the main program with default configuration simply run the executabl ``` You can move the binary to e.g. `~/.local/bin` folder (or any other folder added to your $PATH) to run it from anywhere: + ```shell mv ~/Downloads/donkeytype ~/.local/bin/donkeytype donkeytype --version ``` -By default `donkeytype` saves results of tests to `~/.local/share/donkeytype/donkeytype-results.csv` on **Linux** and **MacOS**, and `C:\Users\{Username}\AppData\Local\donkeytype\donkeytype-results.csv` on **Windows**. +By default `donkeytype` saves results of tests to `~/.local/share/donkeytype/donkeytype-results.csv` on **Linux** and **MacOS**, and `C:\Users\{Username}\AppData\Local\donkeytype\donkeytype-results.csv` on **Windows**. To view the history of results in a bar chart you can run: @@ -46,7 +46,7 @@ To view the history of results in a bar chart you can run: ./donkeytype history ``` -picture demonstraiting bar chart with history data +picture demonstrating bar chart with history data To see all available options run: @@ -65,16 +65,15 @@ Default config looks like this: | ----------------- | --------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `duration` | `30` | number | duration of the test in seconds | | `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input | -| `numbers_ratio` | `0.05` (if numbers=TRUE) | number | ratio for putting numbers in the test | +| `numbers_ratio` | `0.05` (if numbers=true) | number | ratio for putting numbers in the test | +| `symbols` | `false` | boolean | flag indicating if symbols should be inserted in expected input | +| `symbols_ratio` | `0.10` (if symbols=true) | number | ratio for putting symbols in the test | | `uppercase` | `false` | boolean | flag indicating if uppercase letters should be inserted in expected input | -| `uppercase_ratio` | `0.15` | boolean | ratio for putting uppercase letters in test | +| `uppercase_ratio` | `0.15` (if uppercase=true) | boolean | ratio for putting uppercase letters in test | | `dictionary_path` | `None` (builtin dictionary) | string | path to file with dictionary words to sample from while creating test's expected input | | `save_results` | `true` | boolean | flag indicating if results should be saved to a file ( `~/.local/share/donkeytype/donkeytype-results.csv` on Linux and MacOS, and `C:\Users\{Username}\AppData\Local\donkeytype\donkeytype-results.csv` on Windows) | -| `dictionary_path` | `"src/dict/words.txt"` | string | dictionary words to sample from while creating test's expected input - -> NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, default `numbers_ratio = 0.05` will be used. -> Same happens with `uppercase_ratio`. +NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, default `numbers_ratio = 0.15` will be used. Same happens with `uppercase_ratio` and `symbols_ratio`. You can provide this config as options when running the program like so: @@ -143,7 +142,7 @@ To submit a contribution, follow these general steps: If you found this repo because of [Hacktoberfest 2023](https://hacktoberfest.com/), make sure you familiarize yourself with [participation rules for contributors](https://hacktoberfest.com/participation/#contributors). -## Uninstallation +## Uninstalling If you want to remove `donkeytype` from your system you simply remove the executable binary from wherever you've downloaded it to. diff --git a/src/config.rs b/src/config.rs index 2928478..d9ec9e6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,20 +2,19 @@ //! //! Default options of configuration are: //! -//! | name | default value | type in JSON | description | -//! | ----------------- | ---------------------------- | ------------ | --------------------------------------------------------------------------------------- | -//! | `duration` | `30` | number | duration of the test in seconds | -//! | `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input | -//! | `numbers_ratio` | `0.05` (if numbers=TRUE) | number | ratio for putting numbers in the test | -//! | `symbols` | `false` | boolean | flag indicating if symbols should be inserted in expected input | -//! | `symbols_ratio` | `0.10` (if symbols=TRUE) | number | ratio for putting symbols in the test | -//! | `uppercase` | `false` | boolean | flag indicating if uppercase letters should be inserted in expected input | -//! | `uppercase_ratio` | `0.15` | boolean | ratio for putting uppercase letters in test | -//! | `dictionary_path` | `None` (builtin dictionary) | string | path to file with dictionary words to sample from while creating test's expected input | +//! | name | default value | type in JSON | description | +//! | ----------------- | ---------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +//! | `duration` | `30` | number | duration of the test in seconds | +//! | `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input | +//! | `numbers_ratio` | `0.05` (if numbers=true) | number | ratio for putting numbers in the test | +//! | `symbols` | `false` | boolean | flag indicating if symbols should be inserted in expected input | +//! | `symbols_ratio` | `0.10` (if symbols=true) | number | ratio for putting symbols in the test | +//! | `uppercase` | `false` | boolean | flag indicating if uppercase letters should be inserted in expected input | +//! | `uppercase_ratio` | `0.15` (if uppercase=true) | boolean | ratio for putting uppercase letters in test | +//! | `dictionary_path` | `None` (builtin dictionary) | string | path to file with dictionary words to sample from while creating test's expected input | //! | `save_results` | `true` | boolean | flag indicating if results should be saved to a file ( `~/.local/share/donkeytype/donkeytype-results.csv` on Linux and MacOS, and `C:\Users\{Username}\AppData\Local\donkeytype\donkeytype-results.csv` on Windows) | //! -//! NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, Default `numbers_ratio = 0.05` will be used. -//! NOTE: If provided `uppercase_ratio` is not between `0` to `1.0`, Default `numbers_ratio = 0.15` will be used. +//! NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, default `numbers_ratio = 0.15` will be used. Same happens with `uppercase_ratio` and `symbols_ratio`. //! //! Configuration will grow when more features are added (_different modes_, _different languages_). //! diff --git a/src/main.rs b/src/main.rs index fd1782d..d4ee577 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,20 +18,19 @@ //! //! Default options of configuration are: //! -//! | name | default value | type in JSON | description | -//! | ----------------- | ---------------------------- | ------------ | --------------------------------------------------------------------------------------- | -//! | `duration` | `30` | number | duration of the test in seconds | -//! | `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input | -//! | `numbers_ratio` | `0.05` (if numbers=TRUE) | number | ratio for putting numbers in the test | -//! | `symbols` | `false` | boolean | flag indicating if symbols should be inserted in expected input | -//! | `symbols_ratio` | `0.10` (if symbols=TRUE) | number | ratio for putting symbols in the test | -//! | `uppercase` | `false` | boolean | flag indicating if uppercase letters should be inserted in expected input | -//! | `uppercase_ratio` | `0.15` | boolean | ratio for putting uppercase letters in test | -//! | `dictionary_path` | `None` (builtin dictionary) | string | path to file with dictionary words to sample from while creating test's expected input | +//! | name | default value | type in JSON | description | +//! | ----------------- | ---------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +//! | `duration` | `30` | number | duration of the test in seconds | +//! | `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input | +//! | `numbers_ratio` | `0.05` (if numbers=true) | number | ratio for putting numbers in the test | +//! | `symbols` | `false` | boolean | flag indicating if symbols should be inserted in expected input | +//! | `symbols_ratio` | `0.10` (if symbols=true) | number | ratio for putting symbols in the test | +//! | `uppercase` | `false` | boolean | flag indicating if uppercase letters should be inserted in expected input | +//! | `uppercase_ratio` | `0.15` (if uppercase=true) | boolean | ratio for putting uppercase letters in test | +//! | `dictionary_path` | `None` (builtin dictionary) | string | path to file with dictionary words to sample from while creating test's expected input | //! | `save_results` | `true` | boolean | flag indicating if results should be saved to a file ( `~/.local/share/donkeytype/donkeytype-results.csv` on Linux and MacOS, and `C:\Users\{Username}\AppData\Local\donkeytype\donkeytype-results.csv` on Windows) | //! -//! NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, Default `numbers_ratio = 0.05` will be used. -//! NOTE: If provided `uppercase_ratio` is not between `0` to `1.0`, Default `numbers_ratio = 0.15` will be used. +//! NOTE: If provided `numbers_ratio` is not between `0` to `1.0`, default `numbers_ratio = 0.15` will be used. Same happens with `uppercase_ratio` and `symbols_ratio`. //! //! Configuration will grow when more features are added (_different modes_, _different languages_). //!