Improve Forum input box

razvanc-rrazvanc-r Posts: 85Member
I find it strange for a game forum not to have the possibility to add code formatting when writing in the forum :P. Sure, you can use the HTML editing and do
STUFF LIKE THIS
but it always puts it on it's own line and it isn't color coded... and not simple enough. Can't this thing have like a stackoveflow input?... Don't know how difficult it is to implement but I would imagine there are markdown enabled input boxes somewhere around. That would be great.

Answers

  • BinaryOrangeBinaryOrange Posts: 101Big Boss
    edited August 2016 Answer ✓
    Hi and welcome!

    There is a way to paste your code which will highlight. It's shown how in this thread, and this is the result it produces:

    extends Node
    #member vars here
    func _ready():
      pass

    It is still a work in progress but Kiori is hard at work implementing the features that have been requested. :smile: 



  • KioriKiori Posts: 199Admin
    Answer ✓
    extends BaseClass
    
    # member variables
    
    var a = 5
    var s = "Hello"
    var arr = [1, 2, 3]
    var dict = {"key":"value", 2:3}
    
    # constants
    
    const answer = 42
    const thename = "Charly"
    
    # built-in vector types
    
    var v2 = Vector2(1, 2)
    var v3 = Vector3(1, 2, 3)
    


    Code hidden in a spoiler, just to keep it tight.
  • KioriKiori Posts: 199Admin
    edited August 2016 Answer ✓
    This reminded me of something that was on my to-do list: I added a limit to code boxes so now:
    # a file is a class!
    
    # inheritance
    
    extends BaseClass
    
    # member variables
    
    var a = 5
    var s = "Hello"
    var arr = [1, 2, 3]
    var dict = {"key":"value", 2:3}
    
    # constants
    
    const answer = 42
    const thename = "Charly"
    
    # built-in vector types
    
    var v2 = Vector2(1, 2)
    var v3 = Vector3(1, 2, 3)
    
    # function
    
    func some_function(param1, param2):
        var local_var = 5
    
        if param1 < local_var:
            print(param1)
        elif param2 > 5:
            print(param2)
        else:
            print("fail!")
    
        for i in range(20):
            print(i)
    
        while(param2 != 0):
            param2 -= 1
    
        var local_var2 = param1+3
        return local_var2
    
    
    # inner class
    
    class Something:
        var a = 10
    
    # constructor
    
    func _init():
        print("constructed!")
        var lv = Something.new()
        print(lv.a)

    Very long lines of code get packed into one small window.

  • MegalomaniakMegalomaniak Posts: 226Member
    So cool! :)
  • razvanc-rrazvanc-r Posts: 85Member
    Alright! This needs to be more visible somehow! That's awesome :). Thanks guys!
Sign In or Register to comment.