Sign in Join
Wiki copytemporary

wiki documentation

Guide to Wiki Editing

Overview

Tutorials

A Sand Box is available for practice.

If you have any problems, please use this Forum. 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 for sources.

Use the "<syntaxhighlight=pascal>" tag for FPC and Pascal code.

Use the "<syntaxhighlight=delphi>" tag for Delphi code.

Note: "<source=pascal>" could also work but is not recommended (see highlighter docs)

More languages are supported; for a list, see the highlighter docs.

The following example shows the use of the syntax highlighter in this Wiki:

pascal
<syntaxhighlight lang=pascal>
Program Test;
Uses Crt;
pascal
Var I : Integer;
pascal
Begin
  For I := 0 to 12 do
    WriteLn('Test ',I:2);
End.
</syntaxhighlight>

results in this output

pascal
Program Test;
Uses Crt;

Var I : Integer;

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

Below is an example for XML sources.

pascal
<syntaxhighlight lang="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> 
</syntaxhighlight>

which 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>

Below is an example for INI file content:

pascal
<syntaxhighlight lang=ini>
[Section Name]
Name=Value
Height=23
Width=32
</syntaxhighlight>

which results in:

ini
[Section Name]
Name=Value
Height=23
Width=32

For program output or other verbatim quotes simply indent the text by one character like this:

This text is indented from the left margin by one character.

You can also use <pre> and </pre> tags. For example:

pascal
This text begins with the &lt;pre&gt; tag and ends with the &lt;/pre&gt; tag

Keyboard shortcuts

To display keyboard shortcuts use template Template:keypress:

pascal
<code>Ctrl</code>+<code>F12</code>

This will show as:

Ctrl+F12

Note

To make text visible as a note use template Note:

pascal
<blockquote>'''Note:''' This is a note for the reader</blockquote>

This will be displayed as:

Note: This is a note for the reader

Tip

To make text visible as a tip use the Tip template:

pascal
<blockquote>'''Tip:''' This is a tip for the reader</blockquote>

This will be displayed as:

Tip: This is a tip for the reader

Warning

To make text visible as a warning use template Warning:

pascal
<blockquote>'''Warning:''' This is a warning for the reader</blockquote>

This will be displayed as:

Warning: This is a warning for the reader


From the Free Pascal wiki, page "wiki documentation", as it stood on 2020-03-04 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.