WoWWiki:How to edit API pages

Revision as of 15:20, April 8, 2009 by KirkBot (Talk | contribs)

103,496pages on
this wiki

Icon-policy WoWWiki:Guidelines

AddOn pages
API pages
Assume good faith
Be bold!
External links
Fan fiction

Manual of Style
Talk pages
Text removal

See also: policies, administrators
Icon-shortcutShortcut: WW:API

This page is considered a guideline on WoWWiki.

It illustrates standards of conduct, which many editors agree with in principle. However, it is not policy.

The current policy is to separate different kinds of page categories somewhat, and add breadcrumbs to the top of the page to make navigation easier.

  • Don't let these guidelines stop you from creating a page just to add a quick comment about something useful or important that you've learned and want to share! If you just want to write a one-liner, by all means: do so. Just add {{Stub/API}} somewhere in the page so it's easier to find and fix later!
  • Please do not create blank stubs just to get rid of red links. We want the red links there to know that there's no point in clicking it!
  • Brushing up on the API Notation and Conventions might be a good idea

Different types of pages

Below is a list of different types of pages, what boilerplates to use, and what page tags to use.

World of Warcraft API page

Adding and editing function links:

  • There's over one hundred duplicate listings of functions under more than one heading. Try to look for duplicates when changing documentation.
  • Do not place a function under several headings unless you really feel it belongs there. See previous point.
  • Basic link syntax: [[API DisableAddOn|DisableAddOn]](index or "addonname")   →   DisableAddOn(index or "addonname")
  • Don't just say "NEW!" or "REMOVED!". Say in which version! It may be obvious to you when you write it, since it's the current one, but the page has to make sense three months from now, too. And more.

Regular API function pages

Global, honest-to-god APIs, e.g. [UnitName], [AcceptDuel], [GetAddOnDependencies]

FrameXML function pages

These are the "UI" tagged functions, e.g. [ChatFrame_AddChannel], [ToggleBackpack]

Other FrameXML pages

For instance [API AuctionFrameAuctions.duration] et al.

Widget method pages

  • Name the page API WidgetName FunctionName.
  • Do not document the same method in all inherited widgets. Only in the base class. (Actually, don't invent new links at all. Just trust what's already in the Widget API page. Flickering's tools get it right.)
  • Use Help:Widget method articles as a basis for the page.
  • Place {{widgetmethod}} at the top of the page (the boilerplate already has it). Places the page in Category:Widget methods.
  • Remember that you can place generic information in and refer to UISUMMARY WidgetName, e.g. UISUMMARY EditBox.

Data type pages

  • Name the page typeName (no prefix to make it easier to link)
  • Place {{wowapitype}} at the top of the page.
  • Not every argument deserves to be described as a stand-alone data type. E.g. if it's just a 1--n index that every novice hacker can grasp, chances are, it doesn't.

User-defined function pages

UI Technical Details pages

Learning about undocumented functions

So, when you can't go to WoWWiki to learn how a WoW API works, what to do?

  • Ask yourself if the examples really cover everything you need to know:
    • What happens on failure? Does the function return nil or false?
    • That logical test you see, is the function returning 1 or true? It might make a difference to others.
    • Which parameters can be left as nil?
  • TEST your questions. Either by experimenting with the API in an AddOn of yours, or, perhaps easier, use an in-game Lua editor like myDebug!
  • Please help the rest of us and type your findings into WoWWiki :-)

Someone else might have done the hard work without sharing already; if you have a bunch of AddOns installed, try searching in them to see if they use the API. It might tell you more.

See also

Around Wikia's network

Random Wiki