• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

How to add code to posts (1 Viewer)

Sonazuma

Administrator
Staff member
Joined
Jan 6, 2020
Messages
33
Reaction score
10
From the menu:

1.
Click the three dots
2. Click on "</>"

Add_code_step_1.png


Next:

3.
Select the programming language in the dropdown menu
4. Paste your code
5. Click on "continue"

Insert_Lua_code.png


Or:
  • Add your code between write: [CODE]Your code here[/CODE]
    • Result:
      Code:
      Your code here
  • You can also specify a programming language: [CODE=Lua]Your Lua code here[/CODE]
    • Result:
      Lua:
      Your code here
  • For inline code write: [ICODE]Your inline code here[/ICODE]
    • Result: Your inline code here
 
Last edited:

GavinW

Newcomer
Creator of RiscLua
Joined
Oct 21, 2020
Messages
43
Reaction score
17
Age
82
Location
UK
Website
www.wra1th.plus.com
What three dots? I am using the Chrome browser. There is no three-horizontal dots symbol in the menu, only three-vertical-dots which does not do what is indicated in the graphic. Maybe this thread needs updating. A full pop-up (drop-down?) editing guide like the Textile one would be a help.
 

GavinW

Newcomer
Creator of RiscLua
Joined
Oct 21, 2020
Messages
43
Reaction score
17
Age
82
Location
UK
Website
www.wra1th.plus.com
Lua:
print "just testing"
OK, my guess paid off. Users should perhaps need to know how to insert code. They also need to know what the escape mechanism is if they want to use square-bracketed format commands in their text literally. That is why a full explanatory handbook would be good.
 
Last edited:

Coda

Newcomer
Joined
Nov 13, 2020
Messages
1
Reaction score
0
Location
United States
Website
neomidgar.xyz
C++:
#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}
 

GavinW

Newcomer
Creator of RiscLua
Joined
Oct 21, 2020
Messages
43
Reaction score
17
Age
82
Location
UK
Website
www.wra1th.plus.com
I think the server's software must have changed since August 15. It seems that putting CODE=<language> in square brackets starts off a code section and /CODE in square brackets terminates it. What I still do not understand is how to escape such commands when you want to quote them in text.
 

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
93
Reaction score
32
Location
Victoria BC
Website
winlua.net
:LOL:

It's fixed now. Thank you!
Edit: the plugin I had to use to get Lua as the default language had a bug in it so I had to disable it.
Ha. I was wondering. No worries, I've become used to typing [ CODE=lua ]. lol
 
Top