Editing Template:Code/Doc
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
This template is for code. The first argument is the title of the code block | This template is for code. The first argument is the title of the code block or text file. The actual code still needs to be inside a <nowiki><pre>...</pre></nowiki> block. | ||
Example: | |||
<pre>{{Code|input check example|<pre> | |||
if (nargin < 1 || nargin > 4) | |||
print_usage; | |||
<pre> | elseif (!isnumeric (arg1)) | ||
{{Code | error ("first argument should be numeric"); | ||
| | endif | ||
| | </pre>}}</pre> | ||
< | |||
if (nargin < 1 || nargin > 4) | |||
endif | |||
}}</pre> | |||
Will produce: | Will produce: | ||
{{Code|input check example| | {{Code|input check example|<pre> | ||
if (nargin < 1 || nargin > 4) | if (nargin < 1 || nargin > 4) | ||
print_usage; | |||
endif | elseif (!isnumeric (arg1)) | ||
error ("first argument should be numeric"); | |||
endif | |||
</pre>}} | </pre>}} | ||
<noinclude>[[Category:Template Documentation]]</noinclude> | |||
< | |||
[[Category:Template |