Editing tips

From ioquake3 wiki
Jump to: navigation, search

This wiki uses MediaWiki version 1.6.10. For documentation about editing in general, refer to the MediaWiki help page or the Wikimedia help page, which typically contains more detailed information.

Linking to source code

There are several templates that provide convenient links to the source code.

links to a function definition.
links to a typedef definition.
links to a struct field definition.
links to a constant (macro) definition.
links to a variable declaration.
is similar to VarDoc, except that it is used for cvar variables. Also, instead of linking to the variable's declaration, it links to a search page that shows all of the code that uses the variable.


standard use

For basic use of these templates, simply provide the identifier name of the function, type, variable, etc. that you want to link to. For example, this template call will produce this link to MSG_Init():


alternative text

By default, the identifier name will be used in the link. If you want the link to contain different text, provide that text as the second parameter to the template. This example will produce this link to sv_fps:

{{CvarDoc|sv_fps|uses of the sv_fps cvar}}

working with multiple definitions

Some identifiers, such as Sys_GetPacket, are defined in several places. If you use a standard link (like this: Sys_GetPacket()) for such identifiers, the link will take you to a search page that lists all of the definitions, instead of taking you to the definition itself. If you'd like to link to a specific definition, you can pass a "path" named parameter to the template. This example will take you do the Unix definition of Sys_GetPacket().


"Doc" vs. "Def"

FuncDoc, VarDoc, ConstDoc, etc. will not always link you to the source code. If there exists a wiki page with the same name as the identifier passed to the template, the template will generate a link to that wiki page instead. For example, this template call will produce this link to the SV_Frame() wiki page, not a link to the function definition:


To force a link to the definition, replace "Doc" in the template name with "Def". In the example above, we replace the "FuncDoc" template name with "FuncDef" to force a link to the SV_Frame() function definition:


cvar exception

CvarDoc is an exception to the general "Doc" vs. "Def" rule. Since CvarDoc will link to a search page that displays uses of the cvar, the template name that forces that link is "CvarUse", not "CvarDef". Example: Template:CvarUse