Contents (hide)
10 Macros
11 Hebrew
12.2 Code
13.2 Wiki Tree
14 LaTeX

CSWML: Text Formatting

CSWML (CsWiki Markup Language) is language for formatting wiki pages. Its similar to HTML, but has some useful extentions.


<h1>Header 1</h1> or    =Header 1=
<h2>Header 2</h2> or   ==Header 2==
<h3>Header 3</h3> or  ===Header 3===
<h4>Header 4</h4> or ====Header 4====

If page has more than 5 headers, table of content will be added automaticaly.

To prevent header appearance in table of content, add notoc="true" attribute to <h1> ... <h4>.

To prevent table of content, add <notoc/> element to your page.

To show table of content, add <showtoc/> element to your page.

Line Breaks

----- or more minuses makes horizontal line

<br> – same as in HTML

\\ – same as in LaTeX

Two or more newlines in text produces a new paragraph (same as in LaTeX):

First paragraph.

The second one.
First paragraph.

The second one.

Text decorations

<i>italic</i> <b>bold</b> <u>underline</u> <s>strike</s>

A<sup>x</sup> A<sub>y</sub>

<small>small</small> <big>big</big>

Escape Characters

Use \ to mask characters like < or > with special meaning in HTML or Wiki syntax.

Character \ itself is &#92; (\\ is used for line breaks).

Additional Symbols

You can use HTML and unicode entities:
&laquo;Co&ouml;peration&raquo;> produces «Coöperation»

Some shortcuts

More entities examples.

Unordered Lists

<li>Item 1
<li>Item 2
(*)Item 1
(*)Item 2

Ordered Lists

<li> Item 1
<li> Item 2
(#) Item 1
(#) Item 2
  1. Item 1
  2. Item 2

Definition lists

  <dd>young excitable person who may mature
    into a <em>Nerd</em> or <em>Geek</em>
  <dd>a clever programmer
  <dd>technically bright but socially inept person
young excitable person who may mature into a Nerd or Geek
a clever programmer
technically bright but socially inept person


[[ ... ]] makes links. Wiki name can include spaces, so if you write [[just another wiki page]] its actuall name is Just_Another_Wiki_Page but presentation will be kept: just another wiki page.

This Wiki supports multi level page hierarchy. Level defined by / or . in page names.

For example: [[Help/TextFormatting]] – makes TextFormatting to be under Help page.

Alternatively, text after | sign will be link name : [[Help/TextFormatting|text formatting help]]text formatting help

Broken links have different desing: Wiki broken page and by clicking to link you can create this page (if you have enough permissions).

You can create link to uploaded file by [[file:file_name]].
If file is image, you can use [[image:image_file_name]] to include image to the page.
You can upload your files to CourseWiki 2.4.2 by files link in left menu.

You can use [[image:http://some.domain/image.jpg]] in order to create external image.

Sometimes you need extra navigation in a long pages. You can use for that internal anchors.

Use <span id="some-id"></span> for define anchor,and [[PageName#some-id|link to some id]] is for link to the anchor (for same page you can use [[#some-id|link to some id]]).

[[|Google homepage]]Google homepage

[[|mail to]]

There is also posibility to make HTML links :

<a href="">Yahoo!</a>
but for wiki page link use [[ ... ]] syntax.


Call wiki macro using {{WikiMacro(arg1,arg2,arg3,...)}}.

See Macros page for more information.


זאת פסקה בעברית

זאת פסקה בעברית



<nowiki> ... </nowiki> is for unformatted text (without wiki syntax).


<code>...</code> tag is for inline or paragraph unformatted text with program code, file content etc.

It hase two modes:

For inline code you can use @@ ... @@ short form.

<code lang="java">...</code> is for highlighted source code presentation:

  1. import java.sql.*;
  3. public class Zopa{
  4.    public static void main(String[]args){
  5.      System.out.println(new String("Zopa"+100));
  6.    }
  7. }
Languages that also supported: cpp, java, php, python, perl, xml, sql, scheme, latex (add language name to lang="..." property).

To prevent numbering use numbers="false" attribute.

To define filename for code piece, use filename="<file name>" attribute.

For long code pieces use close="true" attribute.

External code source

Code element accepts src="..." attribute and inserts external content into code block. Source can be:
<code src="http://path/to/" lang="java" />

External content taken only when you saves wiki page

Secure block

<secure> ... </secure> is for restricted area

The way to permit access to whole wiki page, check secure checkbox on edit page or add page name to $WIKI_DENIED in include/config.php.

Secure section

If you have whole section(s) under secure block, like this:
=Section Header=
and you click to edit only this section, you will get next code in edit window:
=Section Header=
Do not remove "unclosed" section tag, leave it as-is.

HTML support

Almost all HTML tags and Javascript are supported (except base, basefont, bgsound, blink, body, frame, frameset, head, ilayer, link, meta, style, title, html)


<table class="border">
<tr><td>HTML table cell with <input type="button" value="button" onclick="window.alert(\'Click!\')"/></td></tr>
HTML table cell with


Tags <!-- ... --> and /* ... */ are for comments.

Fancy Widgets

<widget>...</widget> tag used for small floating table with title and content.


<widget title="Hello!" float="left">
 Hello all !!! <br>
Look at your left !!!

Makes this :

Hello all !!!
Look at your left !!!
If you want to break floating, use <br class="clear"/>

Slide Show

Tags <slideshow> and <slide> used for javascript-driven slide show.


<slideshow width="75%">
  <slide align="left">
    This is <br/>
   <b>first</b> slide
  <slide align="center">
    ... and this is <br/>
   <b>second</b> slide
  <slide align="right" title="last slide">
    ... and finally<br/>
   <b>last</b> slide

Attributes for <slideshow> :

Attributes for <slide> :
Tag <slide> is active only under <slideshow> tag.

Meta Wiki Commands

Wiki Include

[[include:Page]] includes content of Page .

Beware of include loops in include.

Wiki Tree

[[tree:Page]] builds tree of wiki pages where Page is their parent.

For example , [[tree:Main]] produces this :

[[blog:user]] , [[blog:user|some text]] makes link to all blog posts of user.

[[blog:user|some text|tag=zopa]] makes link to all blog posts of user tagged zopa.


<inmath>...</inmath> or $$...$$ tags are for inline LaTeX formula (mathematics mode is opened).

For example: If $x \in \mathbb{Q}$ , x is natural number.

<math display="block">...</math>is for LaTeX formulae block (LaTeX math mode does not opened by default).


<math display="block"> \[\sum_{i=0}^{\infty} \frac{cos(n)}{n}\] </math>
makes this:
\[\sum_{i=0}^{\infty} \frac{cos(n)}{n}\]

There is also opportunity to add title (not too long) to LaTeX formula:

<math title="Product"> \[ \prod_{i=1}^N x_i \] </math>
makes this:
Product\[ \prod_{i=1}^N x_i \]

Vertical Alignment for Inline LaTeX

Default vertival alignment for inline LaTeX images is middle, but you can change it using valign="..." attribute in inmath tag.


Here default formula <inmath>x \in \mathbb{Q}</inmath> ...
and down <inmath valign="-50%">x \in \mathbb{Q}</inmath> ...
and up <inmath valign="50%">x \in \mathbb{Q}</inmath>
Here default formula $x \in \mathbb{Q}$ … and down $x \in \mathbb{Q}$ … and up $x \in \mathbb{Q}$

Read more about vertical alignment on W3C.

More about LaTeX :

GNUPlot graphs

You can add GNUplot graphs to page by this directive:

set title "Sample function"
set samples 400, 400
plot [-10:10] real(sin(x)**besj0(x))
produces this Gnuplot GNUplot homepage:


You can add Graphviz graphs to page by this directive
digraph G {Hello->World}
produces this DOT

DOT Parameters

See man dot for more information.

External Program Execution

<exec command="cat /etc/issue"/> will execute command cat /etc/issue and print its output (where html special characters are converted to its entities)

If you need write to standart input of external program, add text between <exec> and </exec> tags:

<exec command="perl">
foreach $f (1...5){
  print $f," ";

If you need command output asis, use format="raw" attribute :

<exec command="some command" format="raw"/>