Canop / Canop/termimad

Feature request: please add custom style syntax

Open
#39 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.2k
Forks
47
Avg merge
3d 16h
Merged PRs (30d)
1

Description

First of all thank you for this great crate! I am using `termimad` to implement a CLI tool which should output text in different colors, not related to bold, italic, code, or strikeout styles. In other words, once I have personalized my bold / italic / code / strikeout styles, then I also need to apply different colors to both stylized and normal text.
It would be great to add the possibility to define new custom syntax. For instance, with reference to the following [example](https://docs.rs/termimad/0.21.0/termimad/#the-skin):
```rust
skin.strikeout = CompoundStyle::new(Some(Red), None, Bold.into());
```
since I need to keep the `strikeout` style for some text, and also apply red bold style to some other text, it would be great to be able to write something like:
```rust
skin.custom_style("rb") = CompoundStyle::new(Some(Red), None, Bold.into());
```
and then apply it for instance as:
```rust
termimad::print_inline("#rb#red bold text!#rb#");
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.