Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improve colour contrast #43

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ serde = "1.0.21"
serde_derive = "1.0.21"
tar = "0.4.14"
time = "0.1.38"
toml = "0.4.6"
walkdir = "2.0.1"
xdg = "2.1.0"

Expand Down
70 changes: 59 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
A very fast implementation of [tldr](https://github.com/tldr-pages/tldr) in
Rust: Simplified, example based and community-driven man pages.

![screenshot](screenshot.png)
<img src="screenshot-default.png" alt="Screenshot of tldr command" width="600">

If you pronounce "tldr" in English, it sounds somewhat like "tealdeer". Hence the project name :)

In case you're in a hurry and just want to quickly try tealdeer, you can find static
binaries on the [GitHub releases page](https://github.com/dbrgn/tealdeer/releases/)!


## Goals

High level project goals:
Expand Down Expand Up @@ -54,20 +55,23 @@ These are the clients I tried but failed to compile or run:
[Go client by anoopengineer](https://github.com/anoopengineer/tldr/),
[PHP client](https://github.com/BrainMaestro/tldr-php).


## Usage

tldr [options] <command>
tldr [options]

Options:

-h --help Show this screen
-v --version Show version information
-l --list List all commands in the cache
-f --render <file> Render a specific markdown file
-o --os <type> Override the operating system [linux, osx, sunos]
-u --update Update the local cache
-c --clear-cache Clear the local cache
-h --help Show this screen
-v --version Show version information
-l --list List all commands in the cache
-f --render <file> Render a specific markdown file
-o --os <type> Override the operating system [linux, osx, sunos]
-u --update Update the local cache
-c --clear-cache Clear the local cache
--config-path Show config file path
--seed-config Create a basic config

Examples:

Expand Down Expand Up @@ -116,14 +120,58 @@ To enable the log output, set the `RUST_LOG` env variable:

$ export RUST_LOG=tldr=debug


### From AUR (Arch Linux)

If you're an Arch Linux user, you can also install the package from the AUR:

$ yaourt -S tealdeer
- [tealdeer](https://aur.archlinux.org/packages/tealdeer/)
- [tealdeer-git](https://aur.archlinux.org/packages/tealdeer-git/)


## Configuration

The tldr command can be customized with a config file called `config.toml`.
Creating the config file can be done manually or with the help of tldr:

$ tldr --seed-config

The configuration file path follows OS conventions. It can be queried with the following command:

$ tldr --config-path

### Style

Using the config file, the style (e.g. colors or underlines) can be customized.

Possible styles:

- `description`: The initial description text
- `command_name`: The command name as part of the example code
- `example_text`: The text that describes an example
- `example_code`: The example itself, except the `command_name` and `example_variable`
- `example_variable`: The variables in the example

Currently supported attributes:

- `foreground` (color string, see below)
- `background` (color string, see below)
- `underline` (`true` or `false`)
- `bold` (`true` or `false`)

The currently supported colors are:

- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `purple`
- `cyan`
- `white`

Example customization:

(Or `tealdeer-git` if you prefer the current development version.)
<img src="screenshot-custom.png" alt="Screenshot of customized version" width="600">


## Bash Autocompletion
Expand Down
2 changes: 1 addition & 1 deletion bash_tealdeer
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _tealdeer()
_init_completion || return

case $prev in
-h|--help|-v|--version|-l|--list|-u|--update|-c|--clear-cache)
-h|--help|-v|--version|-l|--list|-u|--update|-c|--clear-cache|--config-path|--seed-config)
return
;;
-f|--render)
Expand Down
Binary file added screenshot-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshot.png
Binary file not shown.
Loading