doc updates

This commit is contained in:
Timon Post 2019-01-27 21:45:32 +01:00
parent ad74f6b524
commit f7d631e3cd
5 changed files with 73 additions and 3 deletions

View File

@ -15,6 +15,9 @@ edition = "2018"
winapi = { version = "0.3.5", features = ["winnt"] } winapi = { version = "0.3.5", features = ["winnt"] }
crossterm_winapi = { path = "../crossterm_winapi" } crossterm_winapi = { path = "../crossterm_winapi" }
[target.'cfg(unix)'.dependencies]
libc = "0.2.43"
[dependencies] [dependencies]
crossterm_utils = { path = "../crossterm_utils" } crossterm_utils = { path = "../crossterm_utils" }

View File

@ -1,4 +1,6 @@
extern crate crossterm_utils; extern crate crossterm_utils;
#[cfg(unix)]
extern crate libc;
mod input; mod input;
mod sys; mod sys;

View File

@ -9,9 +9,6 @@ extern crate winapi;
#[cfg(windows)] #[cfg(windows)]
extern crate crossterm_winapi; extern crate crossterm_winapi;
#[cfg(unix)]
extern crate libc;
mod screen; mod screen;
mod sys; mod sys;

View File

@ -1,3 +1,15 @@
# Changes crossterm 0.6.0
- Introduced feature flags; input, cursor, style, terminal, screen.
- All modules are moved to their own crate.
- Introduced crossterm workspace
- Less dependencies.
- Improved namespaces.
[PR 84](https://github.com/TimonPost/crossterm/pull/84)
# Changes crossterm 0.5.5
- Error module is made public [PR 78](https://github.com/TimonPost/crossterm/pull/78).
# Changes crossterm 0.5.4 # Changes crossterm 0.5.4
- WinApi rewrite and correctly error handled [PR 67](https://github.com/TimonPost/crossterm/pull/67) - WinApi rewrite and correctly error handled [PR 67](https://github.com/TimonPost/crossterm/pull/67)
- Windows attribute support [PR 62](https://github.com/TimonPost/crossterm/pull/62) - Windows attribute support [PR 62](https://github.com/TimonPost/crossterm/pull/62)

View File

@ -1,3 +1,59 @@
## Upgrade crossterm to 0.6.0
#### Namespace refactor
Some namespaces have been changed. All types of could be used directly by `use crossterm::*;` instead of having to go to a specific module for importing a type.
_**old**_
```rust
crossterm::input::{TerminalInput, ...};
crossterm::style::style;
crossterm::cursor::*;
crossterm::teriminal::{Terminal, ...};
```
_**new**_
```rust
crossterm::{TerminalInput, style, TerminalColor, StyledObject, Terminal, ...}
```
#### Removed unclear methods
```rust
let screen = Screen::new();
// the below methods are not available anymore
cursor::from_screen(&screen);
input::from_screen(&screen);
terminal::from_screen(&screen);
color::from_screen(&screen);
```
Instead of this you should make use of `Crossterm` type
```rust
let screen = Screen::new();
let crossterm = Crossterm::from_screen(screen);
let cursor = crossterm.cursor();
....
```
Or you can use the `from_output()`; this takes in the output stored in `Screen`
```rust
let screen = Screen::new();
let cursor = TerminalCursor::from_output(&screen.stdout);
let input = TerminalInput::from_output(&screen.stdout);
```
#### Wait until takes in a self now.
_**old**_
```rust
TerminalInput::wait_until(KeyEvent::OnKeyPress(b'x'));
```
_**new**_
```rust
let terminal_input = TerminalInput::new();
terminal_input.wait_until(KeyEvent::OnKeyPress(b'x'));
```
## Upgrade crossterm to 0.5.0 ## Upgrade crossterm to 0.5.0
***WARNING*** ***WARNING***