Difference between revisions of "Help:Editing"

From ProgrammingExamples
Jump to: navigation, search
(add suggestion to use syntaxhighlight tag)
(Links to various editing pages at mediawiki)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
=== [http://www.mediawiki.org/wiki/Help:Editing_pages#Editing_rules.2C_editing_conventions.2C_and_formatting Editing Wiki Pages] ===
+
=== Quick tricks ===
* [http://www.mediawiki.org/wiki/Help:Formatting Text Formatting]
+
** [http://www.mediawiki.org/wiki/Help:Links Creating Links]
+
** [http://www.mediawiki.org/wiki/Help:Images Adding Images]
+
** [http://www.mediawiki.org/wiki/Help:Tables Tables]
+
=== 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 ===
+
* To keep your indentation, but '''not''' show syntax highlighting, you may surround your code with ''pre'' tags: <br /><code><nowiki><pre>your code</pre></nowiki></code>
* '''Do'''
+
 
** Create a 'dispatch page' for each new language that you add, put links to examples in that language on that page.
+
=== Editing in general ===
** Try to keep each example as short as possible... and no shorter!
+
* How to use [http://www.mediawiki.org/wiki/Help:Formatting Markup] for bullets, faces, use of HTML
** Try to demonstrate a single concept per example.
+
* How to create [http://www.mediawiki.org/wiki/Help:Links Links] of various kinds
** Comment, comment, comment!
+
* How to make [http://www.mediawiki.org/wiki/Help:Tables Tables]
* '''Don't'''
+
* '''Way''' more than you wanted to know about [http://www.mediawiki.org/wiki/Help:Images Images]
** 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)
+

Latest revision as of 21:19, 20 April 2011

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.
  • To keep your indentation, but not show syntax highlighting, you may surround your code with pre tags:
    <pre>your code</pre>

Editing in general

  • How to use Markup for bullets, faces, use of HTML
  • How to create Links of various kinds
  • How to make Tables
  • Way more than you wanted to know about Images