# Yioop Wiki Syntax

Wiki syntax is a lightweight way to markup a text document so that it can be formatted and drawn nicely by Yioop. This page briefly describes the wiki syntax supported by Yioop.

In wiki syntax headings of documents and sections are written as follows:
=Level1=
==Level2==
===Level3===
====Level4====
=====Level5=====
======Level6======

and would look like:

# Level1

## Paragraphs

In Yioop two new lines indicates a new paragraph. You can control the indent of a paragraph by putting colons followed by a space in front of it:
: some indent

:: a little more

::: even more

:::: that's sorta crazy

which looks like:
some indent
a little more
even more
that's sorta crazy

## Horizontal Rule

Sometimes it is convenient to separate paragraphs or sections with a horizontal rule. This can be done by placing four hyphens on a line by themselves:
----

This results in a line that looks like:

## Text Formatting Within Paragraphs

Within a paragraph it is often convenient to make some text bold, italics, underlined, etc. Below is a quick summary of how to do this:

### Wiki Markup

 ''italic'' italic '''bold''' bold '''''bold and italic''''' bold and italic

### HTML Tags

Yioop also supports several html tags such as:
 delete delete insert insert strike through or strike through  strike through superscript and subscript superscript and subscript typewriter typewriter underline underline

### Spacing within Paragraphs

The HTML entity
&nbsp;
can be used to create a non-breaking space. The tag
<br>
can be used to produce a line break.

## Preformatted Text and Unformatted Text

You can force text to be formatted as you typed it rather than using the layout mechanism of the browser using the
<pre>preformatted text tag.</pre>
Alternatively, a sequence of lines all beginning with a space character will also be treated as preformatted.
Wiki markup within pre tags is still parsed by Yioop. If you would like to add text that is not parsed, enclosed it in <nowiki> </nowiki> tags.

## Styling Text Paragraphs

Yioop wiki syntax offers a number of templates for control the styles, and alignment of text for a paragraph or group of paragraphs:
{{left| some text}},
{{right| some text}},
and
{{center| some text}}
can be used to left-justify, right-justify, and center a block of text. For example, the last command, would produce: {{center| some text }} If you know cascading style sheets (CSS), you can set a class or id selector for a block of text using:
{{class="my-class-selector" some text}}
and
{{id="my-id-selector" some text}}.
You can also apply inline styles to a block of text using the syntax:
{{style="inline styles" some text}}.
For example, {{style="color:red" some text}} looks like {{style="color:red" some text}}.

## Lists

The Yioop Wiki Syntax supported of ways of listing items: bulleted/unordered list, numbered/ordered lists, and definition lists. Below are some examples:

### Unordered Lists

* Item1
** SubItem1
** SubItem2
*** SubSubItem1
* Item 2
* Item 3

would be drawn as:
• Item1
• SubItem1
• SubItem2
• SubSubItem1
• Item 2
• Item 3

### Ordered Lists

# Item1
## SubItem1
## SubItem2
### SubSubItem1
# Item 2
# Item 3

1. Item1
1. SubItem1
2. SubItem2
1. SubSubItem1
2. Item 2
3. Item 3

### Mixed Lists

# Item1
#* SubItem1
#* SubItem2
#*# SubSubItem1
# Item 2
# Item 3

1. Item1
• SubItem1
• SubItem2
1. SubSubItem1
2. Item 2
3. Item 3

### Definition Lists

;Term 1: Definition of Term 1
;Term 2: Definition of Term 2

Term 1
Definition of Term 1
Term 2
Definition of Term 2

## Tables

A table begins with {| and ends with |}. Cells are separated with | and rows are separated with |- as can be seen in the following example:
{|
|a||b
|-
|c||d
|}

 a b c d
Headings for columns and rows can be made by using an exclamation point, !, rather than a vertical bar |. For example,
{|
!a!!b
|-
|c|d
|}

a b
c d
Captions can be added using the + symbol:
{|
|+ My Caption
!a!!b
|-
|c|d
|}

My Caption
a b
c d
Finally, you can put a CSS class or style attributes (or both) on the first line of the table to further control how it looks:
{| class="wikitable"
|+ My Caption
!a!!b
|-
|c|d
|}

My Caption
a b
c d
Within a cell attributes like align, valign, styles, and class can be used. For example,
{|
| style="text-align:right;"| a| b
|-
| lalala | lalala
|}

 a b lalala lalala

## Math

Math can be included into a wiki document by either using the math tag:
$\sum_{i=1}^{n} i = frac{(n+1)(n)}{2}$

 \sum_{i=1}^{n} i = frac{(n+1)(n)}{2}

## Adding Resources to a Page

Yioop wiki syntax supports adding search bars, audio, images, and video to a page. The magnifying class edit tool icon can be used to add a search bar via the GUI. This can also be added by hand with the syntax:
{{search:default|size:small|placeholder:Search Placeholder Text}}

This syntax is split into three parts each separated by a vertical bar |. The first part search:default means results from searches should come from the default search index. You can replace default with the timestamp of a specific index or mix if you do not want to use the default. The second group size:small indicates the size of the search bar to be drawn. Choices of size are small, medium, and large. Finally, placeholder:Search Placeholder Text indicates the grayed out background text in the search input before typing is done should read: Search Placeholder Text. Here is what the above code outputs:
{{search:default|size:small|placeholder:Search Placeholder Text}}
Image, video and other media resources can be associated with a page by dragging and dropping them in the edit textarea or by clicking on the link click to select link in the gray box below the textarea. This would add wiki code such as
( (resource:myphoto.jpg|Resource Description))

to the page. Only saving the page will save this code and upload the resource to the server. In the above myphoto.jpg is the resource that will be inserted and Resource Description is the alternative text to use in case the viewing browser cannot display jpg files. A list of media that have already been associated with a page appears under the Page Resource heading below the textarea. This table allows the user to rename and delete resources as well as insert the same resource at multiple locations within the same document. To add a resource from a different wiki page belonging to the same group to the current wiki page one can use a syntax like:
( (resource:Documentation:ConfigureScreenForm1.png|The work directory form))

Here Documentation would be the page and ConfigureScreenForm1.png the resource.