Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider implementing text modifiers #1

Open
Martoon-00 opened this issue Jan 23, 2022 · 0 comments
Open

Consider implementing text modifiers #1

Martoon-00 opened this issue Jan 23, 2022 · 0 comments
Labels
feature New functionality that may worth a new release

Comments

@Martoon-00
Copy link
Member

Martoon-00 commented Jan 23, 2022

Motivation

Use case 1

Sometimes we want to pass an optional value, and interpolating them as-is usually does not make sense.

Example

  • [int||Something happened. My value is #{mValue}] - here we want "My value is ..." to appear only when mValue is set. In minimalistic cases, we want to at least add conditional space before/after the value.

Use case 2

Text colorizing.

Use case 3

Test padding.

Possible interface

We need to allow abitrary pieces of text into modifier, this can look like

  • [int||look at red%[this colored text]|]

And this new syntax should work when some special switch is enabled.

Handling optionals is trickier, need to think about this. It can look like

  • [int|Something happened. ?[My value is #{mValue}]|]

where ?[...] handles the only interpolated value inside it.

@Martoon-00 Martoon-00 added the feature New functionality that may worth a new release label Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality that may worth a new release
Projects
None yet
Development

No branches or pull requests

1 participant