|
1 |
| -//! Terminal formatting library. |
| 1 | +//! Terminal formatting module. |
2 | 2 | //!
|
3 |
| -//! This crate provides the `Terminal` trait, which abstracts over an [ANSI |
| 3 | +//! This module provides the `Terminal` trait, which abstracts over an [ANSI |
4 | 4 | //! Terminal][ansi] to provide color printing, among other things. There are two
|
5 | 5 | //! implementations, the `TerminfoTerminal`, which uses control characters from
|
6 | 6 | //! a [terminfo][ti] database, and `WinConsole`, which uses the [Win32 Console
|
7 | 7 | //! API][win].
|
8 | 8 | //!
|
9 |
| -//! # Examples |
10 |
| -//! |
11 |
| -//! ```no_run |
12 |
| -//! # #![feature(rustc_private)] |
13 |
| -//! extern crate term; |
14 |
| -//! use std::io::prelude::*; |
15 |
| -//! |
16 |
| -//! fn main() { |
17 |
| -//! let mut t = term::stdout().unwrap(); |
18 |
| -//! |
19 |
| -//! t.fg(term::color::GREEN).unwrap(); |
20 |
| -//! write!(t, "hello, ").unwrap(); |
21 |
| -//! |
22 |
| -//! t.fg(term::color::RED).unwrap(); |
23 |
| -//! writeln!(t, "world!").unwrap(); |
24 |
| -//! |
25 |
| -//! assert!(t.reset().unwrap()); |
26 |
| -//! } |
27 | 9 | //! ```
|
28 | 10 | //!
|
29 | 11 | //! [ansi]: https://en.wikipedia.org/wiki/ANSI_escape_code
|
30 | 12 | //! [win]: https://docs.microsoft.com/en-us/windows/console/character-mode-applications
|
31 | 13 | //! [ti]: https://en.wikipedia.org/wiki/Terminfo
|
32 | 14 |
|
33 |
| -#![doc(html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] |
34 | 15 | #![deny(missing_docs)]
|
35 |
| -#![cfg_attr(windows, feature(libc))] |
36 | 16 |
|
37 | 17 | use std::io::prelude::*;
|
38 | 18 | use std::io::{self, Stderr, Stdout};
|
|
0 commit comments