Changes

Jump to navigation Jump to search
728 bytes added ,  01:47, 19 May 2012
Block code example
Line 5: Line 5:  
{{Code|<nowiki>{{Code|code line}}</nowiki>}}
 
{{Code|<nowiki>{{Code|code line}}</nowiki>}}
   −
See also [[:Template:Block]] for code blocks.
+
{{Code|This is a long line of code that may have many words that continue for a long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long length.}}
    
Used to highlight code samples in an enlarged (through the site's main.css), monospace typeface that is easier to read than the default.
 
Used to highlight code samples in an enlarged (through the site's main.css), monospace typeface that is easier to read than the default.
    
The template form is shorter and easier to enter while editing.
 
The template form is shorter and easier to enter while editing.
 +
 +
==For code blocks==
 +
<pre> <nowiki><nowiki>
 +
Start with a space in the first column,
 +
(before the <nowiki>).
 +
 +
Then your block format will be
 +
    maintained.
 +
 +
This is good for copying in code blocks:
 +
 +
def function():
 +
    """documentation string"""
 +
 +
    if True:
 +
        print True
 +
    else:
 +
        print False</nowiki></nowiki>
 +
</pre>
 +
===Working Example (click edit to see wikicode)===
 +
<nowiki>
 +
def function():
 +
    """documentation string"""
 +
 +
    if True:
 +
        print True
 +
    else:
 +
        print False</nowiki>
 
</noinclude>
 
</noinclude>

Navigation menu