DoubleF3lix / Allay

A parser to convert a descriptive text format into minecraft text components
MIT License
12 stars 2 forks source link

Suggestion: Patterns #1

Closed DoubleF3lix closed 2 years ago

DoubleF3lix commented 3 years ago

The addition of patterns would allow for de-duplication of modifier blocks. An example of their usage is as follows:

@pattern_name = (color=#000000, bold, hover_text=<Basically /clone>)
Here is some [modified text](@pattern_name)

In this case, [modified text](@pattern_name) is equivalent to [modified text](color=#000000, bold, hover_text=<Basically /clone>).

However, merging patterns and other modifiers is valid:

@pattern1 = (bold, italic)
@pattern2 = (underlined, bold=false)

More [text](@pattern1, @pattern2, link="https://example.com")

Patterns should be applied in order that they are listed in, from left to right. In this case, [text](@pattern1, @pattern2, https://example.com) is equivalent to [text](italic, underlined, link="https://example.com"), as the bold modifier in @pattern1 is overridden by @pattern2.

DoubleF3lix commented 2 years ago

Done