Difference between revisions of "Help:Editing"

From ProgrammingExamples
Jump to: navigation, search
(add suggestion to use syntaxhighlight tag)
m (remove extraneous double quote)
Line 4: Line 4:
 
** [http://www.mediawiki.org/wiki/Help:Images Adding Images]
 
** [http://www.mediawiki.org/wiki/Help:Images Adding Images]
 
** [http://www.mediawiki.org/wiki/Help:Tables Tables]
 
** [http://www.mediawiki.org/wiki/Help:Tables Tables]
=== Quick tricks ==="
+
=== Quick tricks ===
 
* To get syntax highlighting, surround your source code with <code><nowiki><source lang="</nowiki>''language''<nowiki>">...</source></nowiki></code> <br />or (preferred) <code><nowiki><syntaxhighlight lang="</nowiki>''language''<nowiki>">...</syntaxhighlight></nowiki></code>. <br />The [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi#Supported_languages list of supported languages] is huge, and includes among many others '''c''', '''cpp''', '''java''', '''perl''', '''python'''. Note: lang attributes are in all lower case.
 
* To get syntax highlighting, surround your source code with <code><nowiki><source lang="</nowiki>''language''<nowiki>">...</source></nowiki></code> <br />or (preferred) <code><nowiki><syntaxhighlight lang="</nowiki>''language''<nowiki>">...</syntaxhighlight></nowiki></code>. <br />The [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi#Supported_languages list of supported languages] is huge, and includes among many others '''c''', '''cpp''', '''java''', '''perl''', '''python'''. Note: lang attributes are in all lower case.
 +
 
=== '''Do'''s and '''Don't'''s for using the Programming Examples Wiki ===
 
=== '''Do'''s and '''Don't'''s for using the Programming Examples Wiki ===
 
* '''Do'''
 
* '''Do'''

Revision as of 13:09, 27 June 2010

Editing Wiki Pages

Quick tricks

  • To get syntax highlighting, surround your source code with <source lang="language">...</source>
    or (preferred) <syntaxhighlight lang="language">...</syntaxhighlight>.
    The list of supported languages is huge, and includes among many others c, cpp, java, perl, python. Note: lang attributes are in all lower case.

Dos and Don'ts for using the Programming Examples Wiki

  • Do
    • Create a 'dispatch page' for each new language that you add, put links to examples in that language on that page.
    • Try to keep each example as short as possible... and no shorter!
    • Try to demonstrate a single concept per example.
    • Comment, comment, comment!
  • Don't
    • Do not treat the wiki as your own personal code dump. Things that are placed here should be useful for many people.
    • Do not "hijack" code someone else has submitted by changing what it does. (Do improve it if you see a way)