From bd35184e2e7b344efe7a5062db37b3ea10782bed Mon Sep 17 00:00:00 2001 From: Sam Tay Date: Thu, 25 Jun 2020 16:53:06 -0700 Subject: Update docs --- README.md | 48 +++++++++++++++++++++++++++++++++++++----------- TODO.md | 5 ++--- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e08de7c..16a6b5c 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,19 @@ $ so -e google -s askubuntu -s stackoverflow -s unix how do i install linux ### release binaries The quickest installation method is to download the appropriate binary from the [release artifacts](https://github.com/samtay/so/releases). +You can quickly +install the binary for common targets (Linux, MacOS, Windows) with: +```shell +curl --proto '=https' --tlsv1.2 -sSf https://samtay.github.io/so/install.sh | bash -s -- --to /usr/local/bin +``` + Right now I'm only building the most common targets, but in theory it should be easy to add more, so if you don't see what you are looking for just open an issue and I can add it. Here's a list of the [supported -targets](https://github.com/japaric/trust#supported-targets). You can quickly -install the binary for your OS with: -```shell -$ curl -LSfs https://samtay.github.io/so/install.sh | \ - sh -s -- --git samtay/so -``` +targets](https://github.com/japaric/trust#supported-targets). If you don't know +what you need, you can install [rustc](https://www.rust-lang.org/tools/install) +and open an issue with the output of `rustc -Vv | grep host | cut -d' ' -f2`. ### cargo ``` @@ -46,12 +49,35 @@ cargo install so ``` ## documentation - -### configuration -**TODO** Document config.yml and explain where to find it. +The configuration files for e.g. a user `Alice` can be found in the following +directories: + +- Linux: `/home/alice/.config/so` +- Windows: `C:\Users\Alice\AppData\Roaming\Sam Tay\so` +- MacOS: `/Users/Alice/Library/Application Support/io.Sam-Tay.so` + +### defaults +The `config.yml` file let's you specify your CLI defaults. So if you dislike the +lucky prompt, always search serverfault.com and unix.stackexchange.com, and +dislike the ethics of Google, you can set your config file like this: +```yaml +# config.yml +--- +api_key: ~ +limit: 10 +lucky: false +sites: + - serverfault + - unix +search_engine: duckduckgo +``` +Run `so --help` to see your current defaults. ### themes -**TODO** Explain colors.toml and explain where to find it. +In the same directory you'll find `colors.toml` which is self-documented. The +default theme attempts to blend in with your default terminal theme, but you can +change it as necessary. There are a couple available themes in the +[themes](./themes) directory. ### api keys If you want to use your own [StackExchange API @@ -75,7 +101,7 @@ In particular, if you specify more than 30 sites, SE will likely ban you for a s ### selecting a backend If you're installing from source, you can choose from a number of available backend rendering engines. Note that the package `default` and `windows` feature -flags do not have an ncurses dependency, for the sake of simplicity. The +flags do not have an ncurses dependency, for the sake of portability. The default backend is [termion](https://github.com/redox-os/termion), a bindless library in pure Rust which seems to work quite well on Linux, MacOS, BSD, and Redox. The windows backend is by default diff --git a/TODO.md b/TODO.md index 40899df..dc818de 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,6 @@ ### chores 1. Make an example GIF -2. [Better](https://gist.github.com/sjparkinson/327dc78c60ab81a06c946630b4288910) - [installation](https://github.com/casey/just) (this is also a good example of github actions). 2. Move to github actions ASAP, travis & appveyor are a PITA. See resources below. 3. Benchmark parsing. Probaly way faster to use regex to find question IDs within URLs (or *gasp* the entire doc). @@ -25,6 +23,7 @@ SpannedString, and own everything... ### feature ideas - Add sort option, e.g. relevance|votes|date - Keep track of quota in a data file, inform user when getting close? +- Maybe allow slimmer builds without TUI that only offer --lucky. #### Endless improvements for the TUI 3. Small text at bottom with '?' to bring up key mapping dialog @@ -40,10 +39,10 @@ SpannedString, and own everything... benefit of incorporating termimad features into a cursive view will not be felt. But, this is changing [soon](https://meta.stackexchange.com/q/348746). - ### resources for later - [Trust example](https://github.com/badboy/signify-rs) - [Github Actions example](https://github.com/extrawurst/gitui) +- [another GA example](https://github.com/casey/just) - [logging example](https://deterministic.space/rust-cli-tips.html) - [PKGBUILD example](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gitui) + openssl dep - More mock user agents -- cgit v1.2.3