https://github.com/schwa/colored_markup
A library for parsing and rendering colored markup with CSS style rules.
https://github.com/schwa/colored_markup
ansi color colored css rust terminal
Last synced: 2 months ago
JSON representation
A library for parsing and rendering colored markup with CSS style rules.
- Host: GitHub
- URL: https://github.com/schwa/colored_markup
- Owner: schwa
- License: mit
- Created: 2023-08-12T22:57:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-30T02:12:01.000Z (11 months ago)
- Last Synced: 2025-03-07T18:12:11.523Z (2 months ago)
- Topics: ansi, color, colored, css, rust, terminal
- Language: Rust
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# colored_markup
A rust library for parsing and rendering coloured markup with CSS style rules.
## Usage
```rust
use colored_markup::{println_markup, StyleSheet};let style_sheet =
StyleSheet::parse("red { foreground: bright-red; styles: underline }").unwrap();
println_markup!(&style_sheet, "The next word is {}", "red");
```See [`examples`](https://github.com/schwa/colored_markup/tree/main/examples) for more.
## License
MIT. See [`LICENSE.txt`](https://github.com/schwa/colored_markup/blob/main/LICENSE.txt) for details.
## TODO
* RGB colour codes in CSS.
* Better CSS parsing error handling.
* Allow changing markup characters.
* CLI tool.
* Better documentation.
* Get rid of re-exports?
* Replace regex with Nom.