https://wiki.datarealms.com/index.php?title=Syntax_Highlighting&feed=atom&action=historySyntax Highlighting - Revision history2024-03-29T09:00:11ZRevision history for this page on the wikiMediaWiki 1.16.5https://wiki.datarealms.com/index.php?title=Syntax_Highlighting&diff=23572&oldid=prevDaman: word choice2012-06-19T17:13:11Z<p>word choice</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 17:13, 19 June 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 35:</td>
<td colspan="2" class="diff-lineno">Line 35:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></lua></PRE></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></lua></PRE></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>When enclosing something in lua tags, <del class="diffchange diffchange-inline">it provides </del>links <del class="diffchange diffchange-inline">back </del>to <del class="diffchange diffchange-inline">the </del>functions <del class="diffchange diffchange-inline">inside </del>the <del class="diffchange diffchange-inline">tags, along with formatting like so</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>When enclosing something in lua tags, links to <ins class="diffchange diffchange-inline">articles for any </ins>functions <ins class="diffchange diffchange-inline">used are automatically added to </ins>the <ins class="diffchange diffchange-inline">code. Example</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><lua></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><lua></div></td></tr>
</table>Damanhttps://wiki.datarealms.com/index.php?title=Syntax_Highlighting&diff=23570&oldid=prevDaman: Backslashes are fine, wrong tags were in the page. Whoops!2012-06-19T17:09:02Z<p>Backslashes are fine, wrong tags were in the page. Whoops!</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 17:09, 19 June 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 37:</td>
<td colspan="2" class="diff-lineno">Line 37:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>When enclosing something in lua tags, it provides links back to the functions inside the tags, along with formatting like so:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>When enclosing something in lua tags, it provides links back to the functions inside the tags, along with formatting like so:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><<del class="diffchange diffchange-inline">cpp</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><<ins class="diffchange diffchange-inline">lua</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> --------------------------</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> --------------------------</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> -- Set up players</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> -- Set up players</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 60:</td>
<td colspan="2" class="diff-lineno">Line 60:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div></<del class="diffchange diffchange-inline">cpp</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></<ins class="diffchange diffchange-inline">lua</ins>></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Notice, however, that backslash characters confuse the parser and should be avoided...</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>='''Advanced tagging(''RECOMMENDED'')'''=</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>='''Advanced tagging(''RECOMMENDED'')'''=</div></td></tr>
</table>Damanhttps://wiki.datarealms.com/index.php?title=Syntax_Highlighting&diff=23565&oldid=prevBrendan: Noticed a cautionary tale2012-06-19T15:39:37Z<p>Noticed a cautionary tale</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:39, 19 June 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 61:</td>
<td colspan="2" class="diff-lineno">Line 61:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></cpp></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></cpp></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Notice, however, that backslash characters confuse the parser and should be avoided...</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>='''Advanced tagging(''RECOMMENDED'')'''=</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>='''Advanced tagging(''RECOMMENDED'')'''=</div></td></tr>
</table>Brendanhttps://wiki.datarealms.com/index.php?title=Syntax_Highlighting&diff=23564&oldid=prevBrendan: typos, word choice, that sort of thing2012-06-19T15:35:19Z<p>typos, word choice, that sort of thing</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:35, 19 June 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=Using highlighting=</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=Using highlighting=</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>A new form of syntax highlighting <del class="diffchange diffchange-inline">as </del>been implemented into the wiki.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>A new form of syntax highlighting <ins class="diffchange diffchange-inline">has </ins>been implemented into the wiki.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Many codetags are <del class="diffchange diffchange-inline">implemented </del>such as:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Many codetags are <ins class="diffchange diffchange-inline">available, </ins>such as:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><<del class="diffchange diffchange-inline">pre</del>> <lua>, <php>, <fortran>, <freebasic>, <vb></<del class="diffchange diffchange-inline">pre</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><<ins class="diffchange diffchange-inline">PRE</ins>> <lua>, <php>, <fortran>, <freebasic>, <vb> </<ins class="diffchange diffchange-inline">PRE</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The main one you should care about on this wiki is of course the Lua tag. <del class="diffchange diffchange-inline">It can be used vanilla like so</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The main one you should care about on this wiki is<ins class="diffchange diffchange-inline">, </ins>of course<ins class="diffchange diffchange-inline">, </ins>the Lua tag. <ins class="diffchange diffchange-inline">Following is an example of literal text you would enter</ins>:</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><<del class="diffchange diffchange-inline">pre</del>><lua></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><<ins class="diffchange diffchange-inline">PRE</ins>><lua></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> --------------------------</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> --------------------------</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> -- Set up players</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> -- Set up players</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 33:</td>
<td colspan="2" class="diff-lineno">Line 33:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div> end</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div></lua></<del class="diffchange diffchange-inline">pre</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></lua></<ins class="diffchange diffchange-inline">PRE</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>When enclosing something in lua tags, it provides links back to the functions inside the tags, along with formatting like so:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>When enclosing something in lua tags, it provides links back to the functions inside the tags, along with formatting like so:</div></td></tr>
</table>Brendanhttps://wiki.datarealms.com/index.php?title=Syntax_Highlighting&diff=414&oldid=prevPetethegoat: Removed from Tutorials category.2010-06-04T18:37:24Z<p>Removed from Tutorials category.</p>
<p><b>New page</b></p><div>__TOC__<br />
<br />
<br />
=Using highlighting=<br />
A new form of syntax highlighting as been implemented into the wiki.<br />
<br />
Many codetags are implemented such as:<br />
<br />
<pre> <lua>, <php>, <fortran>, <freebasic>, <vb></pre><br />
<br />
The main one you should care about on this wiki is of course the Lua tag. It can be used vanilla like so:<br />
<pre><lua><br />
--------------------------<br />
-- Set up players<br />
<br />
for player = 0, self.PlayerCount - 1 do<br />
-- Check if we already have a brain assigned<br />
if not self:GetPlayerBrain(player) then<br />
local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player));<br />
-- If we can\'t find an unassigned brain in the scene to give each player, then force to go into editing mode to place one<br />
if not foundBrain then<br />
self.ActivityState = Activity.EDITING;<br />
AudioMan:ClearMusicQueue();<br />
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/ccambient4.ogg", -1, -1);<br />
else<br />
-- Set the found brain to be the selected actor at start<br />
self:SetPlayerBrain(foundBrain, player);<br />
self:SwitchToActor(foundBrain, player, self:GetTeamOfPlayer(player));<br />
self:SetLandingZone(self:GetPlayerBrain(player).Pos, player);<br />
-- Set the observation target to the brain, so that if/when it dies, the view flies to it in observation mode<br />
self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player)<br />
end<br />
end<br />
end<br />
</lua></pre><br />
<br />
When enclosing something in lua tags, it provides links back to the functions inside the tags, along with formatting like so:<br />
<br />
<cpp><br />
--------------------------<br />
-- Set up players<br />
<br />
for player = 0, self.PlayerCount - 1 do<br />
-- Check if we already have a brain assigned<br />
if not self:GetPlayerBrain(player) then<br />
local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player));<br />
-- If we can\'t find an unassigned brain in the scene to give each player, then force to go into editing mode to place one<br />
if not foundBrain then<br />
self.ActivityState = Activity.EDITING;<br />
AudioMan:ClearMusicQueue();<br />
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/ccambient4.ogg", -1, -1);<br />
else<br />
-- Set the found brain to be the selected actor at start<br />
self:SetPlayerBrain(foundBrain, player);<br />
self:SwitchToActor(foundBrain, player, self:GetTeamOfPlayer(player));<br />
self:SetLandingZone(self:GetPlayerBrain(player).Pos, player);<br />
-- Set the observation target to the brain, so that if/when it dies, the view flies to it in observation mode<br />
self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player)<br />
end<br />
end<br />
end<br />
</cpp><br />
<br />
='''Advanced tagging(''RECOMMENDED'')'''=<br />
<br />
If you want your code tag to look as good as Data, it is recommended to use advanced formatting.<br />
<br />
Here's an example using the same code from before:<br />
<br />
'''Raw:'''<br />
<pre><code lua n><br />
--------------------------<br />
-- Set up players<br />
<br />
for player = 0, self.PlayerCount - 1 do<br />
-- Check if we already have a brain assigned<br />
if not self:GetPlayerBrain(player) then<br />
local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player));<br />
-- If we can\'t find an unassigned brain in the scene to give each player, then force to go into editing mode to place one<br />
if not foundBrain then<br />
self.ActivityState = Activity.EDITING;<br />
AudioMan:ClearMusicQueue();<br />
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/ccambient4.ogg", -1, -1);<br />
else<br />
-- Set the found brain to be the selected actor at start<br />
self:SetPlayerBrain(foundBrain, player);<br />
self:SwitchToActor(foundBrain, player, self:GetTeamOfPlayer(player));<br />
self:SetLandingZone(self:GetPlayerBrain(player).Pos, player);<br />
-- Set the observation target to the brain, so that if/when it dies, the view flies to it in observation mode<br />
self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player)<br />
end<br />
end<br />
end<br />
</code></pre><br />
<br />
<br />
<br />
'''Processed:'''<br />
<br />
<code lua n><br />
--------------------------<br />
-- Set up players<br />
<br />
for player = 0, self.PlayerCount - 1 do<br />
-- Check if we already have a brain assigned<br />
if not self:GetPlayerBrain(player) then<br />
local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player));<br />
-- If we can\'t find an unassigned brain in the scene to give each player, then force to go into editing mode to place one<br />
if not foundBrain then<br />
self.ActivityState = Activity.EDITING;<br />
AudioMan:ClearMusicQueue();<br />
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/ccambient4.ogg", -1, -1);<br />
else<br />
-- Set the found brain to be the selected actor at start<br />
self:SetPlayerBrain(foundBrain, player);<br />
self:SwitchToActor(foundBrain, player, self:GetTeamOfPlayer(player));<br />
self:SetLandingZone(self:GetPlayerBrain(player).Pos, player);<br />
-- Set the observation target to the brain, so that if/when it dies, the view flies to it in observati mode<br />
self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player)<br />
end<br />
end<br />
end<br />
</code><br />
<br />
<br />
As you can see this formatting is much more appealing. The links also underline as they are intended to, 100% of the time. Any more questions can be asked in discussion page, and the tags available can be checked on the versions page.</div>Petethegoat