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

Feature - AnsiComponentSerializer #140

Closed
wants to merge 15 commits into from
Closed

Feature - AnsiComponentSerializer #140

wants to merge 15 commits into from

Conversation

Narimm
Copy link

@Narimm Narimm commented Aug 17, 2020

Creates a serializer that can turn components into ansi formatted text.

note deserialization simply strips… escape codes and returns plain text.

… escape codes and returns plain text.

todo - finish tests
@Narimm Narimm changed the title [DRAFT} Feature ConsoleComponentSerializer Feature ConsoleComponentSerializer Aug 17, 2020
@Narimm
Copy link
Author

Narimm commented Aug 17, 2020

I have made the changes you requires however its failing checkstyle on the enum class with a public method getAnsi() I am not sure what format for methods it wants...from the checkstly it looks like it wants getANSI()

@Narimm Narimm changed the title Feature ConsoleComponentSerializer Feature - AnsiComponentSerializer Aug 17, 2020
Rename parameter to reflex class
@Narimm Narimm requested a review from kashike September 2, 2020 06:38
1. Jansi moved to be an implementation
2. Removed the static lists in the Format class - they were not required.
ANSI v Ansi
@Narimm Narimm requested a review from zml2008 October 4, 2020 13:20
@Narimm
Copy link
Author

Narimm commented Oct 6, 2020

I have rebased the branch on the latest 4.x master and done all the Javadocs for this one.

@zml2008
Copy link
Member

zml2008 commented Jan 1, 2021

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) {
  // [...]
}

@Narimm Narimm requested a review from Electroid January 3, 2021 13:13
@Narimm
Copy link
Author

Narimm commented Jan 3, 2021

Rebased and applied requested changes

@Narimm
Copy link
Author

Narimm commented Jan 14, 2021

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) {
  // [...]
}

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.
I checked a couple and I didn't see the variable mentioned in that GIST

@zml2008
Copy link
Member

zml2008 commented May 31, 2021

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.

zml2008 pushed a commit that referenced this pull request Dec 7, 2021
Includes simple tests for the new placeholder resolvers
Includes a test for #140 which is fixed now thanks to #144
@Narimm Narimm closed this by deleting the head repository Oct 19, 2022
@rymiel rymiel mentioned this pull request Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add a serializer that produces ansi formatted text including colors
4 participants