Skip to content

Commit

Permalink
Merge pull request #81 from Builditluc/feature/improve-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Builditluc authored Nov 14, 2022
2 parents c5d0b97 + 3576cd3 commit b0a3f15
Show file tree
Hide file tree
Showing 49 changed files with 1,268 additions and 729 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ panic-message = "0.3.0"
backtrace = "0.3"
toml = "0.5.9"
structopt = "0.3.25"
chrono = "0.4"

[dependencies.cursive]
version = "0.17"
Expand All @@ -41,6 +42,9 @@ default-features = false
# git = "https://github.com/gyscos/cursive_buffered_backend"
version = "0.6.0"

[dependencies.cursive-aligned-view]
version = "0.6.0"

[dependencies.reqwest]
version = "0.11"
features = ["json", "blocking"]
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
## Preview
### How it looks

![image](https://user-images.githubusercontent.com/37375448/139769364-46a69dce-f386-4369-a82e-4a45adac3b52.png)
![image](https://user-images.githubusercontent.com/37375448/139769469-0b2e9f01-f758-4bb2-8227-4186f658cfcc.png) <br>
![preview-1](docs/assets/images/preview-1.png)
![preview-2](docs/assets/images/preview-2.png)
![preview-3](docs/assets/images/preview-3.png)
> Note: These Screenshots were taken on [iTerm2](https://iterm2.com) (MacOS) with the [Fira Code](https://github.com/tonsky/FiraCode) font
For more information, please visit the [website](https://builditluc.github.io/wiki-tui/)
Expand Down
Binary file added docs/assets/images/border-heavy-1.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 docs/assets/images/border-heavy-2.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 docs/assets/images/border-round-1.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 docs/assets/images/border-round-2.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 docs/assets/images/border-thin-1.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 docs/assets/images/border-thin-2.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 modified docs/assets/images/preview-1.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 modified docs/assets/images/preview-2.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 docs/assets/images/preview-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/configuration/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The following modes are supported
| Key | Config Name |
|----------------|-------------|
| | `normal` |
| ++shift++ | `shit` |
| ++shift++ | `shift` |
| ++alt++ | `alt` |
| ++alt+shift++ | `altshift` |
| ++ctrl++ | `ctrl` |
Expand Down
44 changes: 44 additions & 0 deletions docs/configuration/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,49 @@ highlight_text = "white"
text = "black"
```

## Configure the borders

:fontawesome-solid-microchip: pre-release
:octicons-milestone-16: Default: `default` | `thin`

!!! warning
Depending on your font, some border styles may differ from the examples below

You can change the look of the borders in wiki-tui. Available styles are:

* `thin` | `default`
* `heavy`
* `round`

> The excat unicode characters used for the borders can be found in the following file: `src/ui/panel.rs`
??? example "Thin / Default"
```toml
theme.border = "default"
```
or
```toml
theme.border = "thin"
```

![Border-Thin-1](../assets/images/border-thin-1.png)
![Border-Thin-2](../assets/images/border-thin-2.png)

??? example "Heavy"
```toml
theme.border = "heavy"
```

![Border-Heavy-1](../assets/images/border-heavy-1.png)
![Border-Heavy-2](../assets/images/border-heavy-2.png)

??? example "Round"
```toml
theme.border = "round"
```

![Border-Round-1](../assets/images/border-round-1.png)
![Border-Round-2](../assets/images/border-round-2.png)

[release-0.3.0]: https://github.com/Builditluc/wiki-tui/releases/tag/v0.3
[release-0.4.0]: https://github.com/Builditluc/wiki-tui/releases/tag/v0.4
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ A simple and easy to use Wikipedia Text User Interface
<center>
![Preview-1](assets/images/preview-1.png)
![Preview-2](assets/images/preview-2.png)
![Preview-3](assets/images/preview-3.png)
</center>

??? note "About those Screenshots"
They were taken on MacOS (iTerm2) with the gruvbox terminal colorscheme. The only
configuration change that was done is setting the borders to round

# What can I do with it?

## Search
Expand Down
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repo_url: https://github.com/builditluc/wiki-tui

theme:
name: material
custom_dir: overrides
icon:
logo: material/console
repo: fontawesome/brands/github
Expand All @@ -18,6 +19,7 @@ theme:
- navigation.top
- navigation.sections
- navigation.indexes
- announce.dismiss
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
Expand All @@ -40,7 +42,7 @@ nav:
- Configuration:
- configuration/index.md
- Api Settings: configuration/api.md
- Changing the Colors: configuration/theme.md
- Changing the Theme: configuration/theme.md
- Configure the Logging: configuration/logging.md
- Features: configuration/features.md
- Keybindings: configuration/keybindings.md
Expand Down
18 changes: 18 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}

{% block announce %}

v0.6.0 is out now!
Changes include:

<ul>
<li>Multiple border types</li>
<li>A better looking default theme</li>
<li>Cleaner UI</li>
<li>Popup Searchbar (Press Shift+S inside of an article)</li>
<li>Auto generation of the configuration file</li>
</ul>

And more!

{% endblock %}
37 changes: 37 additions & 0 deletions src/backend.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use cursive::backends;
use cursive_buffered_backend::BufferedBackend;

#[cfg(feature = "blt-backend")]
pub fn backend() -> Box<BufferedBackend> {
let blt_backend = backends::blt::Backend::init();
let buffered_backend = BufferedBackend::new(blt_backend);
Box::new(buffered_backend)
}

#[cfg(feature = "termion-backend")]
pub fn backend() -> Box<BufferedBackend> {
let termion_backend = backends::termion::Backend::init().unwrap();
let buffered_backend = BufferedBackend::new(termion_backend);
Box::new(buffered_backend)
}

#[cfg(feature = "crossterm-backend")]
pub fn backend() -> Box<BufferedBackend> {
let crossterm_backend = backends::crossterm::Backend::init().unwrap();
let buffered_backend = BufferedBackend::new(crossterm_backend);
Box::new(buffered_backend)
}

#[cfg(feature = "pancurses-backend")]
pub fn backend() -> Box<BufferedBackend> {
let pancurses_backend = backends::curses::pan::Backend::init().unwrap();
let buffered_backend = BufferedBackend::new(pancurses_backend);
Box::new(buffered_backend)
}

#[cfg(feature = "ncurses-backend")]
pub fn backend() -> Box<BufferedBackend> {
let ncurses_backend = backends::curses::n::Backend::init().unwrap();
let buffered_backend = BufferedBackend::new(ncurses_backend);
Box::new(buffered_backend)
}
Loading

0 comments on commit b0a3f15

Please sign in to comment.