Wiki Help

Revision Difference

Garry's_Mod_Wiki_Editing_Guidelines#519229

<cat>editing</cat>⤶ # Requirements⤶ ⤶ In order to maintain consistency on the wiki, we require you to follow next rules.⤶ ⤶ ## Templates⤶ ⤶ ### Class methods⤶ ⤶ ```⤶ <page>Entity:SetModel</page>⤶ ```⤶ ⤶ Produces: [Entity:SetModel](/gmod/Entity:SetModel)⤶ ⤶ ### Library functions:⤶ ⤶ ```⤶ <page>ents.Create</page>⤶ ```⤶ ⤶ Produces: [ents.Create](/gmod/ents.Create)⤶ ⤶ ### Global functions:⤶ ⤶ ```⤶ <page>Global.AddCSLuaFile</page>⤶ ```⤶ ⤶ Produces: [AddCSLuaFile](/gmod/Global.AddCSLuaFile)⤶ ⤶ ### Hooks:⤶ ```⤶ <page>ENTITY:Initialize</page>⤶ ```⤶ ⤶ Produces: [ENTITY:Initialize](/gmod/ENTITY:Initialize)⤶ ⤶ ### Enumerations:⤶ ```⤶ <page>Enums/ACT</page>⤶ ```⤶ ⤶ Produces: [ACT](/gmod/Enums/ACT)⤶ ⤶ ### Structures:⤶ ```⤶ <page>Structures/TraceResult</page>⤶ ```⤶ ⤶ Produces: [Structures/TraceResult](/gmod/Structures/TraceResult)⤶ ⤶ ### Types, classes, libraries and panels:⤶ ```⤶ <page>string</page>, <page>ConVar</page>, <page>table</page>, <page>DFrame</page>⤶ ```⤶ ⤶ Produces: [string](/gmod/string), [ConVar](/gmod/ConVar), [table](/gmod/table), [DFrame](/gmod/DFrame)⤶ ⤶ ### Shaders:⤶ ```⤶ <page>Shaders/gmodscreenspace</page>⤶ ```⤶ ⤶ Produces: [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 comma, bracket like so:⤶ ```lua⤶ function ENT:Think()⤶ self:MyFunction( "test argument", 1, false )⤶ end⤶ ```