DRAFT |
Style Guide: Function Pages
This guide provides specific instructions for editing or adding your own content to each section of the Function pages in this wiki.
Contents
General Guidelines
Function pages should provide basic information about the SDL functions to allow users to most effectively utilize them in their projects.
Please observe the following:
- Do not post anything that you do not have permission to post publicly.
- Sections other than Code Examples and Remarks should have adequate details to make them clear and useful while remaining brief wherever possible.
- Please remember to keep it simple and easy to understand.
- Do not remove, modify, or add section headings unless specifically mentioned below.
For assistance with editing, saving, or wiki-appropriate markup see the Wiki Basics Style Guide.
Editing Specific Sections
Title
Do not edit the Title.
The Title section consists of the page heading = SDL_FunctionName = and should match the address of the page and the function described on the page.
If you believe a change is necessary please contact us at <ANTI SPAM wiki AT libsdl DOT org>.
Description
The Description section does not have a heading but immediately follows the page title.
All function descriptions begin with:
Use this function to
followed by a clear and concise description of what the function does.
Note: Information presented in this section is limited. Extended description information for more complicated functions should be placed in the Remarks section instead.
red
Do not create a link to the Remarks section in the description if additional information is located there.
Note: As always, if another API page is referenced in the description be sure to hyperlink it and use () outside the link markup if it is a function.
Table of Contents
Do not edit the Table of Contents.
The Table of Contents consists of the following markup and is generated automatically on the parsed page.
<<TableOfContents()>>
If you believe a change is necessary please contact us at <ANTI SPAM wiki AT libsdl DOT org>.
Syntax
The Syntax section consists of a code box that contains the basic format and components of the function with some specific formatting conventions. Please apply the following conventions when editing this section.
The basic format is as follows:
{{{#!highlight cpp
returnType* SDL_FunctionName(type1 parameter1,
type2* parameter2,
...
typeN parameterN)
}}}red
All types and parameters should be vertically aligned.
- Spacing for parameter types is left-aligned to the first line.
- Spacing for parameters is left-aligned to the longest param type so that there is only 1 space between the longest type and its parameter.
Markup: Use spaces as necessary to create the correct alignment. Within a code box spacing is fixed-width.
Note: Pointers (*, **) should be aligned next to the types (no space between) and should have at least one space following.
Note: To be omitted
- All additional text that may be found in the header or elsewhere, such as extern, SDLCALL, etc.
The space between SDL_FunctionName and (.
- Ending semi-colon (;)
Note: To be included
A space between returnType and SDL_FunctionName
- Commas at the end of each line if there is more than 1 param
Note: Do not remove or alter the code box markup surrounding the function syntax.
Example:
{{{#!highlight cpp
1 space no space spaces (as needed)
| \ |_________|
SDL_AudioSpec* SDL_LoadWAV_RW(SDL_RWops* src,
int freesrc,
SDL_AudioSpec* spec, <- longest type
Uint8** audio_buf, sets alignment
Uint32* audio_len)
|||||||||||||||||||||||||||||| \ |
spaces (as needed) no space 1 space
}}}Function Parameters
Return Value
Code Examples
Remarks
Related Functions
Footer
Resources
Our goal is to create accurate, consistent, helpful, user-friendly documentation. We appreciate your efforts to make your additions fit into the existing framework and retain the same look and feel as much as possible.
If you have questions that aren't addressed here:
- Search for another page that contains something similar to what you want to do and copy all the basics as much as applicable.
Check the other SDL Style Guides.
Post a question to Feedback and
include a way to contact you.
Post a question to the Mailing List
Send a comment or question to <ANTI SPAM wiki AT libsdl DOT org> for clarification.
If you have suggestions for changes or additions to this document or any other portion of the wiki please don't hesitate to contact us with your thoughts. We are happy to have the participation!
Disclaimer
All content modifications are subject to review for consistency and quality. We reserve the right to remove or modify any content added to this wiki at any time. You may direct questions or concerns to <ANTI SPAM wiki AT libsdl DOT org>.
