https://github.com/remexre/sparkly-rs
A pretty-printing library based on Wadler's "A Prettier Printer" with support for ANSI styling.
https://github.com/remexre/sparkly-rs
ansi-styles pretty-print rust
Last synced: about 1 month ago
JSON representation
A pretty-printing library based on Wadler's "A Prettier Printer" with support for ANSI styling.
- Host: GitHub
- URL: https://github.com/remexre/sparkly-rs
- Owner: remexre
- Created: 2018-01-10T23:13:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-10T04:43:14.000Z (almost 7 years ago)
- Last Synced: 2025-03-28T08:08:06.199Z (about 2 months ago)
- Topics: ansi-styles, pretty-print, rust
- Language: Rust
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sparkly-rs
[](https://travis-ci.org/remexre/sparkly-rs)
[](https://crates.io/crates/sparkly)
[](https://docs.rs/sparkly/*/sparkly/)
Currently, the performance is really bad; [pretty.rs](https://crates.io/crates/pretty) may be preferred.
A pretty-printing library based on Wadler's "A Prettier Printer" with support for ANSI styling.
I'm using this to walk myself through the paper and understand it well enough to implement; plus it doesn't look like there's an existing implementation of this.
## Features and Optional Dependencies
[`termion`](https://crates.io/crates/termion): Allows the width and color support of the terminal to be autodetected.
## TODOs
- When `impl Trait` is stabilized, use `impl Display` instead of the `Display` struct.
- `no_std` support.
- Opt-in [`unicode-width`](https://crates.io/crates/unicode-width)
- Windows (before 10) support? A good project might be a `(&mut Write, &str, Style) -> IoResult<()>` function that uses Windows syscalls there and ANSI everywhere else.## License
Licensed under either of
* Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (http://opensource.org/licenses/MIT)at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.