#1) Use AI to determine if there is more than couple of lines of code in the post and display an embedded message at the top giving how to format code instructions.
#2) Move the Preformatted text icon to be at the front. Rename it to Format Code. Many times it even hides on my tablet to the gear icon.
#3) Your topic similar to… panel on the right is confusing to many new users as they don’t know there is a preview behind it. I would change the esc X button changed to just say Preview Post
All-around excellent suggestions. If you’re looking to help someone with a topic, it’s mildly frustrating to be met with code that isn’t formatted. There have been many times in which I completely skip reading a post simply because of this very issue.
I doubt that you need to use AI to detect code that is in need of formatting. You likely just need a list of keywords (or keyword combinations) that prompt the hint.
I’m just thinking one of the reasons also is that when code is pasted in to the post, why not at least keep the tabs or at least convert them to spaces (maybe 5)?
Example code I just pasted. It looks fine when I paste it. However the tabs are erased which messes it up. At the very least convert them to spaces. May not look color coded, but in most case it is understood.
func press_enter():
var enter_key:=InputEventKey.new()
enter_key.keycode=KEY_ENTER
enter_key.pressed = true
Input.parse_input_event(enter_key)
func _on_gui_input(event):
if event is InputEventKey and event.keycode >= 32 and event.keycode <= 167:# and event.is_pressed():
var caretln=get_caret_line()
if caretln > MAX_LINES:
accept_event()
elif get_line(caretln).length() > MAX_LENGTH:
if get_line_count() < MAX_LINES:
press_enter()
else:
accept_event()
And this is what it looks like formatted without the language tag.
func press_enter():
var enter_key:=InputEventKey.new()
enter_key.keycode=KEY_ENTER
enter_key.pressed = true
Input.parse_input_event(enter_key)
func _on_gui_input(event):
if event is InputEventKey and event.keycode >= 32 and event.keycode <= 167:# and event.is_pressed():
var caretln=get_caret_line()
if caretln > MAX_LINES:
accept_event()
elif get_line(caretln).length() > MAX_LENGTH:
if get_line_count() < MAX_LINES:
press_enter()
else:
accept_event()
The explanation when creating a new post should include formatting code using ``` or [code] [/code] and mention the code button.
Currently it is pretty vague for people not familiar with these kind of things.
May be AB-testing hiding the button, the ctrl+e shortcut has also been removed for me? Seems like a really bad call. I think it’s AB tests as this change isn’t on chromium.
The forum app is Powered by Discourse (note at bottom). I am wondering what control if any does an admin have over customization. Any admins here who could answer that with regards to this topic?
Just putting in my two cents here, they should definitely have formatted code in the new user tutorial. It’s pretty much an essential feature.
Plus, all the other suggestions in this post should absolutely be implemented at some point. Just to smooth out the new user experience. Any bit helps with redundancies.
I would like to add to this conversation.
I just found out (after my formated text showed in grey for some reason and had to google it) that you can manually set the language of the highlight by typing it after the ```
Ok so going back to my AI thought to detect if there is code in a post and notify user posting to format it using tags.
I asked the following question from gemini.google.com. Not only did gemini understand the code it gave me pretty detailed explanation, although I could tell it to spare me the details.
Please reformat this text below.
I have this code and do not understand it. Please help me all you experts. I am just a beginner!
func press_enter():
var enter_key:=InputEventKey.new()
enter_key.keycode=KEY_ENTER
enter_key.pressed = true
Input.parse_input_event(enter_key)
func _on_gui_input(event):
if event is InputEventKey and event.keycode >= 32 and event.keycode <= 167:# and event.is_pressed():
var caretln=get_caret_line()
if caretln > MAX_LINES:
accept_event()
elif get_line(caretln).length() > MAX_LENGTH:
if get_line_count() < MAX_LINES:
press_enter()
else:
accept_event()
Here is a list of things that make work easier for all members and save them from suffering, but we are still waiting; exactly why is there no explanation, reaction, or change regarding this issue??
If it is so hard for the community to implement any of the above items, at least apply this, as it is evident that changing the default text of posts is really possible for forum administrators:
Instead of the current format:
Current format
Godot Version
Replace this line with your Godot version
Question
Ask your question here! Try to give as many details as possible
Use this so that everyone understands what they need to do and will do it, and we will no longer see anyone keeping the original text of their question between two " ` "; why has the formatted text been used to provide explanations in the initial format?
New format
Godot Version
Replace this line with your Godot version
Question
Ask your question here! Try to give as many details as possible
You can use this format for share you codes:
extends Example
...
# Please use this formation for share your codes with put ``` before & after your code
This will lead many users to format their codes correctly, and it will strongly prevent users from formatting regular text as inline code in accordance with the initial conditions!
I would mark it as solution except I don’t want to close the thread. It should be just a simple template. I don’t even think you need the version since its part of checkboxes.
And have the option in profile to turn it off. It would be on by default for new users.