wiki documentation

From Lazarus wiki
Revision as of 14:44, 11 June 2007 by Hansiglaser (talk | contribs) (Syntax Highlighting)
Jump to navigationJump to search

Guide to Wiki Editing

Overview

Tutorials

A Sand Box is available for practice.

If you have any problems, please notify the site administrator or post a bug report on the Lazarus-CCR SF site. You can also leave a note or suggestion on our Site Feedback page.

Syntax Highlighting

A Wiki for a programming language site needs a powerful way of showing source code in readable fashion. Therefore we use an automatic syntax highlighter to add sources. Use the "<delphi>" tags for FPC code and the "<xml>" tag for XML code. The following example shows the use of the syntax highlighter in this Wiki:

<delphi>
Program Test;
Uses Crt;

Var I : Integer;

Begin
  For I := 0 to 12 do
    WriteLn('Test ',I:2);
End.
</delphi>

results in this output <delphi> Program Test; Uses Crt;

Var I : Integer;

Begin

 For I := 0 to 12 do
   WriteLn('Test ',I:2);

End. </delphi>

For XML sources use the "<xml>" and "</xml>" tags.

<xml>
  <xs:complexType name="DecimalWithUnits">
    <xs:simpleContent>
      <xs:extension base="xs:decimal">
        <xs:attribute name="Units" type="xs:string"
                      use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType> 
</xml>

results in <xml>

 <xs:complexType name="DecimalWithUnits">
   <xs:simpleContent>
     <xs:extension base="xs:decimal">
       <xs:attribute name="Units" type="xs:string"
                     use="required"/>
     </xs:extension>
   </xs:simpleContent>
 </xs:complexType> 

</xml>

For program output or other verbatim quotes please use the "<pre>" and "</pre>" tags.

Note that the syntax highlighter will be changed in the future. Currently MediaWiki 1.9 is installed and uses an unofficial syntax highlighter. Within a year MediaWiki 1.10 will be installed, which has an official syntax highlighter. This will require a different syntax: <source lang="delphi">.