Difference between revisions of "Entering Code into the Wiki"

From AGI Wiki
Jump to navigationJump to search
(Created page with "For constancy through out the Wiki, whenever entering AGI code into the Wiki, please format any code like this: <pre><div class="CodeBlockHeader">Code:</div> <syntaxhighlight...")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
<pre><div class="CodeBlockHeader">Code:</div>
 
<pre><div class="CodeBlockHeader">Code:</div>
<syntaxhighlight lang="agi">code goes here.</syntaxhighlight></pre>
+
<div class="CodeBlockStyle">
 +
<syntaxhighlight lang="agi">code goes here.</syntaxhighlight></div></pre>
  
 
Which will result in this:
 
Which will result in this:
  
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
<syntaxhighlight lang="agi">code goes here.</syntaxhighlight>
+
<div class="CodeBlockStyle">
 +
<syntaxhighlight lang="agi">code goes here.</syntaxhighlight></div>
  
 
Syntax highlighting will automatically be added:
 
Syntax highlighting will automatically be added:
  
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
 +
<div class="CodeBlockStyle">
 
<syntaxhighlight lang="agi">/******************************************************************************
 
<syntaxhighlight lang="agi">/******************************************************************************
 
  AGI Template Game
 
  AGI Template Game
 
  ******************************************************************************
 
  ******************************************************************************
/******************************************************************************/</syntaxhighlight>
+
/******************************************************************************/</syntaxhighlight></div>
  
 
You use it in lieu of 'pre' tags. Because it acts like &lt;pre&gt; tags it will preserve the code's formatting without having to add nonbreaking spaces ('''&amp;nbsp;''') or line breaks tags ('''&lt;br /&gt;''').
 
You use it in lieu of 'pre' tags. Because it acts like &lt;pre&gt; tags it will preserve the code's formatting without having to add nonbreaking spaces ('''&amp;nbsp;''') or line breaks tags ('''&lt;br /&gt;''').
Line 29: Line 32:
  
 
[[category:Formatting Help]]
 
[[category:Formatting Help]]
 +
[[Category:Wiki Help]]

Latest revision as of 14:24, 8 October 2015

For constancy through out the Wiki, whenever entering AGI code into the Wiki, please format any code like this:

<div class="CodeBlockHeader">Code:</div>
<div class="CodeBlockStyle">
<syntaxhighlight lang="agi">code goes here.</syntaxhighlight></div>

Which will result in this:

Code:
code goes here.

Syntax highlighting will automatically be added:

Code:
/******************************************************************************
 AGI Template Game
 ******************************************************************************
/******************************************************************************/

You use it in lieu of 'pre' tags. Because it acts like <pre> tags it will preserve the code's formatting without having to add nonbreaking spaces (&nbsp;) or line breaks tags (<br />).

This will make the code much more readable while maintaining/editing it. Other language syntax highlighting can be used if the language is changed in the code in the syntaxhighlight tag. For example, to use C++ highlighting you would change it to:

<syntaxhighlight lang="cpp">

For a list of other language codes, see this table.

As usual, you can experiment with it on the Test page.