Why Godot Q&A has no syntax highlighting?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fcole90

Hi, I’m a web developer, and I’d be happy to contribute to this great project.

Thank you everyone for creating such a great project!

Whenever I’m here on Godot Q&A I find it always hard to read the questions and answers, and one of the reasons is that this website has no syntax highlighting. Code and text are blended together in a very hard to read result.

So, I have two questions:

  1. Is there any plan to move to some other platform, like discourse or something else alike?
  2. Is there any way I can suggest the introduction of syntax highlighting (even on this platform) and possibly contribute to it?

Example of how code looks now (using code sample pressing the { } button):

extends Node

export (PackedScene) var mob_scene = preload("res://Mob.tscn")

func _ready():
randomize()

func _on_MobTimer_timeout():
var mob = mob_scene.instance()
var mob_spawn_location = $SpawnPath/SpawnPathFollow
mob_spawn_location.unit_offset = randf()

var player_position = $Player.transform.origin

add_child(mob)
mob.initialise(mob_spawn_location.translation, player_position)

The indentation is totally messed up, and very time consuming to fix.


Another example, but using the ```` ` syntax:

extends Node

export (PackedScene) var mob_scene = preload("res://Mob.tscn")

func _ready():
	randomize()

func _on_MobTimer_timeout():
	var mob = mob_scene.instance()
	var mob_spawn_location = $SpawnPath/SpawnPathFollow
	mob_spawn_location.unit_offset = randf()
	
	var player_position = $Player.transform.origin
	
	add_child(mob)
	mob.initialise(mob_spawn_location.translation, player_position)
	

Restating my questions:

  1. Is there any plan to move to some other platform, like discourse or something else alike?
  2. Is there any way I can suggest the introduction of syntax highlighting (even on this platform) and possibly contribute to it?

The indentation is totally messed up, and very time consuming to fix.

I had a look at the code you pasted and it is messed up already. You mixed tabs and spaces (or the website mixed tabs and space, no idea how).

I have no idea if there are plans to change.
Maybe you could open an issue on Issues · godotengine/godot-website · GitHub
Or contact devs on Godot.Chat, I think there is a website room: Godot Contributors Chat

Zylann | 2022-04-04 13:05

Thanks Zylann, I’ll try to discuss the issue there!

About the code above, the code I pasted was correct, but the thing that the { } button does, is to indent your code with some spaces, so when then you then paste your code from Godot, it becomes so messed up XD It can be fixed, but it’s definitely time-consuming.

fcole90 | 2022-04-04 14:33

Yeah usually I dont really use that button. Instead I just select the code in my editor, indent it by 1 level by pressing Tab once, copypaste it directly into the website and it works fine.

Zylann | 2022-04-04 21:56

Oh, that’s a very nice workaround until we have something better!

fcole90 | 2022-04-06 08:00