Revision Difference
Garry's_Mod_Wiki_Editing_Guidelines#517218
<cat>editing</cat>⤶
# Requirements
In order to maintain consistency on the wiki, we require you to follow next rules.
## Templates
- Сlass methods:
- Code: `<page>Entity:SetModel</page>`
- Preview: [Entity:SetModel](/gmod/Entity:SetModel)
- Library functions:
- Code: `<page>ents.Create</page>`
- Preview: [ents.Create](/gmod/ents.Create)
- Global functions:
- Code: `<page>Global.AddCSLuaFile</page>`
- Preview: [AddCSLuaFile](/gmod/Global.AddCSLuaFile)
- Hooks:
- Code: `<page>ENTITY:Initialize</page>`
- Preview: [ENTITY:Initialize](/gmod/ENTITY:Initialize)
- Enumerations:
- Code: `<page>ACT</page>`
- Preview: [ACT](/gmod/ACT)
- Structures:
- Code: `<page>Structures/TraceResult</page>`
- Preview: [Structures/TraceResult](/gmod/Structures/TraceResult)
- Types, classes and panels:
- Code: `<page>string</page>` `<page>ConVar</page>` `<page>DFrame</page>`
- Preview: [string](/gmod/string) [ConVar](/gmod/ConVar) [DFrame](/gmod/DFrame)
- Libraries:
- Code: `<page>table</page>`
- Preview: [table](/gmod/table)
- Shaders:
- Code: `<page>Shaders/gmodscreenspace</page>`
- Preview: [Shaders/gmodscreenspace](/gmod/Shaders/gmodscreenspace)
## Lua Code
- In descriptions or in articles wrap your Lua code in \`\`\`lua \`\`\` tags manually. This is done automatically for function examples.
```lua
local function foo()
print("bar")
end
```
- Inline code \`code\`
- Hello `CallThisFunction( "With these arguments" )` World!
## Page Content
- It's **Lua**, not **LUA**, **LUa**, **lua** or **LuA**.
- It's **SENT**, not **SEnt**.
- It's **SWEP**, not **SWep**.
- It's **TOOL**, not **STOOL**.
- If you don't know how to name an argument or describe it, don't put **UNKNOWN** or anything like that, just leave it blank.
- Put **proper descriptions** for arguments and return values, not just their names with one word.
- Argument names **must** start with a lower case letter.
- `Position` is bad, `pos` is good.
- Do **not** put type indentifier as first letter.
- `iNum` is bad, `num` is good.
## Examples
- Try to make the examples be ready for use by other people, they shouldn't produce errors if people copy it into a Lua file or use lua_run.
- For gamemode hook examples, use the [hook library](/gmod/hook.Add) instead of `GM:HookName`.
- Examples must not rely on addons being installed
- If output of an example is not available, don't put `N/A`, just leave the field empty.
- Try to match coding style of your examples with coding style of other examples on other pages.
- Do not put **any** semicolons (`;`).
- Keep underscores to minimum.
- Use [Entity](/gmod/Global.Entity)( 1 ) for player.
- Use [Vector](/gmod/Global.Vector)( 0, 0, 0 ) and [Angle](/gmod/Global.Angle)( 0, 0, 0 ) for arguments, not just something like `vPos`.
- Use `Player1` in place of a player's nickname in example output. Additional players can be `Player2`, `Player3`, and so on.
- Use `STEAM_0:1:12345678` in place of player's SteamID in example output.
- Avoid useless globals.
- Use **--**, not **//**.
- Try to space out function arguments to make the code more readable, put a space after each coma, bracket like so:
```lua
function ENT:Think()
self:MyFunction( "test argument", 1, false )
end
```