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

x/playground: Please bring color and editor to playground #34227

Open
dackon opened this issue Sep 11, 2019 · 4 comments

Comments

@dackon
Copy link

commented Sep 11, 2019

Currently, the playground is yellow background and black text, make it difficult to read the codes. Can you make codes colorful and bring editor to playground (like Wandbox) ?

@gopherbot gopherbot added this to the Unreleased milestone Sep 11, 2019

@ALTree

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

This was asked in the past. The most relevant discussion is at #28539.

To sum it up:

  • the tour (https://tour.golang.org) has syntax colouring powered by CodeMirror (a rather beefy js lib)
  • the playground code doesn't use CodeMirror and has no syntax colouring
  • Apparently, codemirror is huge and it was decided not to add it to the playground, which is currently very simple (see final decision at #18723)
  • Adding colouring to the playground has been on the table (see my comment at #28539 (comment)), but since it was decided not to use CodeMirror in the playground, we would need to either use a lightweight library or implement it from scratch

Essentially: it appears that adding syntax colouring for the playground would be okay, but someone needs to do the work and without using a beefy 3rd party lib like the one the tour uses.

@dackon

This comment has been minimized.

Copy link
Author

commented Sep 11, 2019

Duplicate of #28539.

@dackon dackon closed this Sep 11, 2019

@ALTree

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

#28539 is closed. This should be left open as the canonical reference for this work.

@beoran

This comment has been minimized.

Copy link

commented Sep 20, 2019

I think we could base ourselves on MicroLight: https://asvd.github.io/microlight/ , but change it so it recognises Go code only specifically. This also has the advantage that it highlights syntax without using color, only using font effects or a literal highlight effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.