Skip to content

Feature request: please add custom style syntax #39

@lucatrv

Description

@lucatrv

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:

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:

skin.custom_style("rb") = CompoundStyle::new(Some(Red), None, Bold.into());

and then apply it for instance as:

termimad::print_inline("#rb#red bold text!#rb#");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions