-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Feature - AnsiComponentSerializer #140
Conversation
… escape codes and returns plain text. todo - finish tests
...rc/main/java/net/kyori/adventure/text/serializer/console/ConsoleComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...le/src/main/java/net/kyori/adventure/text/serializer/console/ConsoleComponentSerializer.java
Outdated
Show resolved
Hide resolved
text-serializer-console/src/main/java/net/kyori/adventure/text/serializer/console/Formats.java
Outdated
Show resolved
Hide resolved
Finalize tests - passing
I have made the changes you requires however its failing checkstyle on the enum class with a |
text-serializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/Formats.java
Outdated
Show resolved
Hide resolved
text-serializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/Formats.java
Outdated
Show resolved
Hide resolved
Rename parameter to reflex class
text-serializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/Formats.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializer.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializer.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
text-serializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/Formats.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/test/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializerTest.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/AnsiComponentSerializer.java
Outdated
Show resolved
Hide resolved
1. Jansi moved to be an implementation 2. Removed the static lists in the Format class - they were not required.
ANSI v Ansi
I have rebased the branch on the latest 4.x master and done all the Javadocs for this one. |
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Outdated
Show resolved
Hide resolved
...zer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerImpl.java
Outdated
Show resolved
Hide resolved
...ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerImpl.java
Show resolved
Hide resolved
It would be good to implement some colour detection strategies from https://gist.github.com/XVilka/8346728 if it's possible to do without a hard dependency on JLine -- maybe some method like: enum ColorSupport { TRUE, LIMITED_256, LIMITED_16 }
public static ColorSupport colorLevel(final Consumer<String> output, final Supplier<String> input) {
// [...]
} |
…alizer # Conflicts: # settings.gradle
Fix licenses Fix checkstyle
Rebased and applied requested changes |
My understanding of this is the presence of the SYSTEM environment setting is highly inconsistent but MOST terminals will handle the escape codes for colours they cant portray by either dithering them or ignoring them and stripping them. |
to keep the info in one place, I'm planning on breaking this into two parts: a small shim in adventure itself, and an ansi serializer detached from any particular object model at https://github.com/KyoriPowered/ansi. unfortunately time's been limited so this PR hasn't seen much activity, hoping to get back to it sometime. i can push my WIP on the adventure side if anyone else is interested in picking it up. |
Creates a serializer that can turn components into ansi formatted text.
note deserialization simply strips… escape codes and returns plain text.