|
Size: 7116
Comment: in progress
|
← Revision 39 as of 2013-09-01 18:53:08 ⇥
Size: 8907
Comment: Updated usage of Color2 macro.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%"style="color: rgb(255, 0, 0); text-align: center;">DRAFT|| <<Color2(green,Note: text in green is possible additional/alternate text or questions to be removed in future edits.)>> |
|
| Line 8: | Line 6: |
| This guide provides the instructions needed to add your own content to the Code Examples or Remarks sections of the Function, Enumeration, and Structure pages in this wiki. {X} '''You must have permission to make other contributions, edit existing content, or create new pages. Please email docs@libsdl.org to request permission.''' |
This guide provides instructions for adding your own content to the Code Examples or Remarks sections of the API pages in this wiki. |
| Line 14: | Line 10: |
| == Before You Start == Anyone may contribute '''Code Examples''' or '''Remarks''' per the instructions in this Style Guide. Please check back periodically for updates. /!\ Due to spammers, write access to this wiki is disabled by default. If you would like to contribute to this wiki, we welcome your contribution! Just send an e-mail to <<MailTo(ANTI SPAM docs AT libsdl DOT org)>> so we can give you write access. If you would like to make other contributions beyond code examples and remarks, such as editing existing content or developing tutorials, please email <<MailTo(ANTI SPAM docs AT libsdl DOT org)>> to coordinate efforts. |
|
| Line 15: | Line 19: |
<!> '''Existing content, including markup, should not be modified or removed.''' |
|
| Line 16: | Line 23: |
| If a page can be edited you will see two options in the left column to choose from: 1. <<Color2(blue,Edit (Text))>> The Text editor provides more power/flexibility for editing than the GUI editor but requires that you know the wiki markup. Use the Text editor to see the content with raw markup. You will need to use the Preview feature to view the content as it will appear when saved <<Color2(green,rendered)>>. (!) '''Specific markup instructions on this page are for use with the Text editor but should also work in the GUI editor.''' |
If a page can be edited you will see two options to choose from in the left column: 1. <<Color2(col=blue,text="Edit (Text)")>> The Text editor provides more power/flexibility for editing than the GUI editor but requires that you know the wiki markup. Use the Text editor to see the content with raw markup. You will need to use the Preview feature to view the content as it will appear when saved. (!) '''Specific markup instructions in this guide are for use with the Text editor but should also work in the GUI editor.''' |
| Line 22: | Line 29: |
| 1. <<Color2(blue,Edit (GUI))>> | 1. <<Color2(col=blue,text="Edit (GUI)")>> |
| Line 24: | Line 31: |
| (!) The GUI editor is fairly self-explanatory however, if you require further assistance, see [[http://wiki.libsdl.org/moin.cgi/HelpOnGraphicalEditor|HelpOnGraphicalEditor]] for more detailed instructions. | (!) The GUI editor is fairly self-explanatory; however, if you require further assistance, see [[http://wiki.libsdl.org/moin.cgi/HelpOnGraphicalEditor|HelpOnGraphicalEditor]] for more detailed instructions. Note that some formatting will appear slightly different in preview mode than on the finished screen. |
| Line 32: | Line 42: |
| <<Color2(green,Sam - Are there other sample comments we could put in to illustrate the kind of info that would help you monitor changes more efficiently?)>> | |
| Line 34: | Line 43: |
| When you have completed adding your content and are satisfied with the formatting use the <<Color2(blue,Save Changes)>> link in the left column to save your changes. | {i} Especially when using the text editor, use the <<Color2(col=blue,text="Preview")>> function in the left sidebar before saving your changes to ensure that the markup you have included is producing the desired result as well as to scan for errors in a different view. When you have completed adding your content and are satisfied with the formatting use the <<Color2(col=blue,text="Save Changes")>> function in the left sidebar to save your changes. |
| Line 48: | Line 59: |
| ---- /!\ ~+<<Color2(red,Existing content,)>> <<Color2(red,including markup,)>> <<Color2(red,should not be modified or removed.)>>+~ ---- |
|
| Line 53: | Line 62: |
| (!) The following instructions apply to all Function, Enumeration, or Structure pages unless specifically noted. In most cases functions will be referenced for simplicity. This is not meant to exclude structures or enumerations. | {{{#!wiki tip '''The following instructions apply to all API pages unless specifically noted.''' }}} |
| Line 56: | Line 67: |
| The Code Examples section provides verbatim examples of the real-world application of the API. | The Code Examples section provides simple examples of real-world applications of the API. |
| Line 58: | Line 69: |
| {OK} Please post code examples showing how you have used <<Color2(green,implemented)>> the API that may benefit other users. | {OK} Please post code examples showing how you have used the API that may benefit other users. |
| Line 60: | Line 71: |
* Code examples should have adequate comments to make them clear and useful. |
|
| Line 63: | Line 76: |
| * If there are existing examples please add yours to the end, or to a related section if there are many examples of various types. . ''Example'': [[SDL_Init]]() * All content should be added within this markup. |
* If there are existing examples please add a new code box to the end of the examples section, or add your code to the end of a related group if there are many examples of various types. * To add a new code box insert the following into the spot where your example will be located: |
| Line 72: | Line 83: |
| . ''Example'': [[SDL_Init]]() | |
| Line 73: | Line 85: |
| <!> Do not remove or modify any existing code examples. | * All content should be added within this markup (on the blank line with the markup above and below your example content). |
| Line 75: | Line 87: |
| <<Color2(green,'''Sam - are there any instructions about the actual code that should be included here?''')>> | <!> '''Do not remove or modify any existing code examples.''' * Please remember to keep it simple and easy to understand. |
| Line 88: | Line 102: |
| * If your remark includes a reference to a specific function parameter use '''bold''' wherever the parameter's name is used. {{{'''parameter'''}}} = '''parameter''' . ''Example'': [[SDL_ConvertAudio]]() |
<!> '''Do not remove or modify any existing remarks.''' * If your remark includes a reference to a function's parameter or structure's data field directly related to that page's topic use '''bold''' wherever the name is used. .''Markup'': use 3 apostrophes surrounding the text for bold. {{{'''parameter'''}}} = '''parameter''' . ''Example'': [[SDL_ConvertAudio]]() . ''Example'': [[SDL_AudioSpec]] * Do NOT use bold for enumeration value names. . ''Example'': [[SDL_GLattr]] . If your remark includes a reference to a parameter or data field in ''another'' function or structure than the one specifically discussed on that page (such as referencing a member of a structure on a function's page), use `monospace` wherever the name is used. .''Markup'': use a single backtick surrounding the text for monospace. {{{`member`}}} = `member` . ''Example'': [[SDL_OpenAudio]]() |
| Line 94: | Line 118: |
| {{{[[SDL_Function]]()}}}<<BR>> Include open and closed parentheses after a function name, outside of the hyperlink markup.<<BR>> {{{[[SDL_Enumeration/Structure]]}}}<<BR>> Do not use parentheses for enumerations or structures. |
.''Markup'': use two brackets surrounding the page name (must be exact) for a link. {{{[[SDL_Function]]()}}} = [[SDL_Function]]() . Include open and closed parentheses, outside of the hyperlink markup, after a function name. (see above) . Do not use parentheses for enumerations or structures. .{{{[[SDL_Enumeration/Structure]]}}} |
| Line 100: | Line 125: |
| * <<Color2(green, Should instructions for anchors and linking to function parameters be included here or would that be considered a 'major edit' and should be reserved for the other page?)>> | |
| Line 102: | Line 126: |
| <!> Do not remove or modify any existing remarks. | |
| Line 104: | Line 127: |
| {i} <<Color2(green, All content additions are subject to review. We reserve the right to remove or modify any content added to this wiki by any user at any time without notice. You may direct questions or concerns to docs@libsdl.org.)>> | == The Bottom Line == Our goal is to create clean, consistent, helpful, user-friendly documentation. Please try to make your changes or additions fit into the existing framework, and retain the same look and feel as much as possible. When in doubt a) look for another page that contains the same thing you want to do and copy all the basics as much as applicable. b) send a comment or question to <<MailTo(ANTI SPAM docs 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 <<MailTo(ANTI SPAM docs AT libsdl DOT org)>> with your thoughts. We are happy to have the participation! |
| Line 106: | Line 137: |
| <<Color2(green, Category`Support?)>> | == Disclaimer == {{{#!wiki note All content additions are subject to review. We reserve the right to remove or modify any content added to this wiki at any time. You may direct questions or concerns to <<MailTo(ANTI SPAM docs AT libsdl DOT org)>>. }}} |
SDL API Contribution Style Guide
This guide provides instructions for adding your own content to the Code Examples or Remarks sections of the API pages in this wiki.
Contents
Before You Start
Anyone may contribute Code Examples or Remarks per the instructions in this Style Guide. Please check back periodically for updates.
Due to spammers, write access to this wiki is disabled by default. If you would like to contribute to this wiki, we welcome your contribution! Just send an e-mail to <ANTI SPAM docs AT libsdl DOT org> so we can give you write access.
If you would like to make other contributions beyond code examples and remarks, such as editing existing content or developing tutorials, please email <ANTI SPAM docs AT libsdl DOT org> to coordinate efforts.
The Basics
Existing content, including markup, should not be modified or removed.
Opening An Editor
If a page can be edited you will see two options to choose from in the left column:
Edit (Text)
- The Text editor provides more power/flexibility for editing than the GUI editor but requires that you know the wiki markup. Use the Text editor to see the content with raw markup. You will need to use the Preview feature to view the content as it will appear when saved.
Specific markup instructions in this guide are for use with the Text editor but should also work in the GUI editor. For information on wiki markup not included here, or other MoinMoin-specific questions, please see the wiki help documentation. Edit (GUI)
- The GUI editor provides buttons, much like a simple word processor, to add formatting markup such as bolding text, making a table, or creating a numbered list. It is simpler to use than the Text editor but does not provide buttons for all the possible markup. Use the GUI editor to see the content appear roughly as it would on the screen as you edit or if you do not know or want to use the wiki markup.
The GUI editor is fairly self-explanatory; however, if you require further assistance, see HelpOnGraphicalEditor for more detailed instructions.
Note that some formatting will appear slightly different in preview mode than on the finished screen.
Saving Your Changes
Before you save your changes please include a note in the Comment field below the editing box that summarizes what you have done.
Sample comments:
- added comment to end of remarks
- added code example to C++ section
- remarked on use of function with [sound card model]
Especially when using the text editor, use the Preview
function in the left sidebar before saving your changes to ensure that the markup you have included is producing the desired result as well as to scan for errors in a different view.
When you have completed adding your content and are satisfied with the formatting use the Save Changes
function in the left sidebar to save your changes.
Automatic Backup of Drafts
(copied from: Help On Editing)
- Every time you are in the editor and use the "Preview", "Spell Check", "Cancel" or "Save Changes" buttons, moin saves a draft copy of your work internally. Use preview often! If you hit "cancel" accidentally, your machine crashes, or the browser window was accidentally closed, then the automatic backup of your draft may be easily recovered.
To recover that draft, you simply edit that page again. If there is a draft, an alert message will be in the message box and a "load draft" button will be present. Clicking the "load draft" will load your saved draft into the editor box replacing the current revision already loaded. You can continue editing the loaded draft, but this time try to save it at the end.
Don't use the "preview", "spell check", "save changes" or "cancel" buttons on that page before "load draft" or you will overwrite your old draft with a new one. If you successfully save a page, the internal draft copy of it is not needed any more and will be deleted.
The Specifics
The following instructions apply to all API pages unless specifically noted.
Adding Code Examples
The Code Examples section provides simple examples of real-world applications of the API.
Please post code examples showing how you have used the API that may benefit other users.
- Do not post anything that you do not have permission to post publicly.
- Code examples should have adequate comments to make them clear and useful.
If the Code Examples section is empty please replace
You can add your code example here
with your code.- If there are existing examples please add a new code box to the end of the examples section, or add your code to the end of a related group if there are many examples of various types.
- To add a new code box insert the following into the spot where your example will be located:
{{{#!highlight cpp }}}Example: SDL_Init()
- All content should be added within this markup (on the blank line with the markup above and below your example content).
- To add a new code box insert the following into the spot where your example will be located:
Do not remove or modify any existing code examples.
- Please remember to keep it simple and easy to understand.
Adding Remarks
The Remarks section provides additional information related to other sections on the page as well as a location for users to add comments related to real-world application of the API.
Please post your appropriate remarks that may benefit other users.
- Do not post anything that you do not have permission to post publicly.
If the Remarks section is empty please replace
''You can add useful comments here''
with your remarks.- If there are existing remarks please add yours to the end, or to a related grouping if there are remarks covering the same topic.
Example: SDL_MixAudio()
Do not remove or modify any existing remarks.
If your remark includes a reference to a function's parameter or structure's data field directly related to that page's topic use bold wherever the name is used.
Markup: use 3 apostrophes surrounding the text for bold.
'''parameter''' = parameter
Example: SDL_ConvertAudio()
Example: SDL_AudioSpec
- Do NOT use bold for enumeration value names.
Example: SDL_GLattr
If your remark includes a reference to a parameter or data field in another function or structure than the one specifically discussed on that page (such as referencing a member of a structure on a function's page), use monospace wherever the name is used.
Markup: use a single backtick surrounding the text for monospace.
`member` = member
Example: SDL_OpenAudio()
- Create hyperlinks if you reference an existing function, enumeration, or structure.
Note: Although the wiki will automatically create links in many cases, it does not recognize the SDL names correctly so you must manually hyperlink them.
Markup: use two brackets surrounding the page name (must be exact) for a link.
[[SDL_Function]]() = SDL_Function()
- Include open and closed parentheses, outside of the hyperlink markup, after a function name. (see above)
- Do not use parentheses for enumerations or structures.
[[SDL_Enumeration/Structure]]
Example: SDL_BuildAudioCVT()
The Bottom Line
Our goal is to create clean, consistent, helpful, user-friendly documentation. Please try to make your changes or additions fit into the existing framework, and retain the same look and feel as much as possible.
When in doubt
- a) look for another page that contains the same thing you want to do and copy all the basics as much as applicable.
b) send a comment or question to <ANTI SPAM docs 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 <ANTI SPAM docs AT libsdl DOT org> with your thoughts. We are happy to have the participation!
Disclaimer
All content additions are subject to review. 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 docs AT libsdl DOT org>.
