FAQinEnglish * FormatRule * FormatExample
The input text of PukiWiki is usually shown in the same way as it was entered. However, you can use the following rules to enhance your texts. The use of HTML tags is forbidden. Instead, special characters can be used to format text. Formatting rules usually apply to a certain part of the text. Such a part of a text is called a text Element.
First of all, let's describe the "world" of PukiWiki. PukiWiki treats text as a set of Elements. An empty line indicates the end of an Element. Elements can contain other Elements. Such contained Elements are called "Child Elements". The element which contains "Child Elements" is called a "Parent Element".
Example: These two lines:
~This is a paragraph. It is the parent element which contains an emphasized text element. ''This is emphasized text, which is the child element of the paragraph element.''Will be formatted like this:
This is a paragraph. It is the parent element which contains an emphasized text element. This is emphasized text, which is the child element of the paragraph element.
There are two kinds of elements in PukiWiki: "Block Elements", and "Inline Elements". Block Elements, as the name suggests, consist of a whole block of text. Inline Elements only consist of a part of a text block. In essence, the difference between Block Elements and Inline Elements is as follows:
Next, we'll describe the two different kinds of elements in detail.
Inline Elements
PukiWiki assumes that each new Block is the beginning of a new paragraph, unless you instruct it to format the text differently, by using the formatting codes of other Block Elements.
~Inline Elements
A line that starts with "~" indicates the beginning of a new paragraph. "~" also enables you escape the special characters (~、-、+、:、>、|、#、//) that are normally used as "Formatting Characters". Normally, these characters indicate the beginning of another kind of Element. Thus, the only way to put the special characters as a normal text at the beginning of a Paragraph is by putting a "~" in front of them.
>Inline Element
A ">" character indicates the beginning of Quotation. Quotation has 3 indentation levels, indicated by: ">", ">>", and ">>>".
-Inline Element
At the beginning of a line,"-" indicates the beginning of an Unordered List. Unordered lists have three levels, namely:"-", "--", and "---".
+Inline Element
At the beginning of a line, "+" indicates the beginning of Numbered List. Numbered List has three levels namely:"+", "++", and "+++".
:Item|Item's Definition
Definition List is a line starting with ":" and separated by "|" in the middle. There are three indentation levels for Definition List: ":", "::", and ":::".
You may omit the Item or the Definition. You may give multiple definitions to an item by writing a sequence of Definition List and omitting the Item after the first one.
"White Space" at the beginning of a line indicates the beginning of Preformatted Text. Line breaks are not automatically inserted in Preformatted Text.
|Inline Element|Inline Element|
Inline Elements that are separated by "|", will be formatted as a Table. Remember that there needs to be a "|" character as well before the first Element of the table.
AAAA|BBB|CCC|DDD
|AAA|BBB|CCC|DDD|
AAA | BBB | CCC | DDD |
LEFT: CENTER: RIGHT: BGCOLOR(colorcode): COLOR(colorcode): SIZE(unit:px):
bbbb | bbbb | H E A D |
aaaaa | foot | aaaaa |
Here is a Sample | regarding to the placements | of elements in each cell |
Flush Left | Centered | Flush Right |
Flush Right | Flush Left | Centered |
rowspan | BLUE | RED |
colspan |
LEFT: CENTER: RIGHT: BGCOLOR(colorcode): COLOR(colorcode): SIZE(unit:px):
,Inline Element,Inline Element,…
Inline Elements that are separated by ","(comma), will be formatted as a Table. Note that you must write "," before the first Element of the CSV Style Table.
aaaaaaaaa | bbbbbbb | ccccccc |
left | center | right |
<-- colspan | test |
*Inline Element
A line that starts wit an "*" character becomes a Heading Element. There are three levels of heading Elements, namely: "*", "**",and "***".
#contents
"#contents" at the beginning of the line creates Table of Contents based on the Headings. Generally, "#contents" are written on the top part of the page.
LEFT:Inline Element CENTER:Inline Element RIGHT:Inline Element
Writing "LEFT:", "CENTER:", or "RIGHT:" at the beginning of the line aligns the Inline Element.
----
Four "-" placed at the beginning of a line are shown as a Horizon Line.
#ref(file name) #ref(URL of the file)
You can attach a file by writing #ref(file name) at the beginning of a line. You can place a hypertext link by writing #ref(URL of the file) at the beginning of a line. If the file attached or linked is an image, the image is displayed.
Page of the attachment file
left center right
wrap no wrap
around
nolink
Substitute Strings
#comment
"#comment" at the beginning of the line embeds a form to post comments.
#pcomment
"#pcomment" at the beginning of the line embeds a form to post comments. Unlike "#comment", posted comments are recorded on a separate page. Also, responses to a comment is displayed as tree structure.
#article
"#article" at the beginning of the line embeds a simple forum.
#vote(Option1,Option2,...)
"#vote" at the beginning of the line embeds a simple form for voting.
Strings
Strings are an Inline Element.
Inline Element~
Writing "~" at the end of the line inserts End of Line a line break. End of Line is a line break within a Block Element.
&br;
Writing &br; breaks the line. Unlike "~" at the end of the line, Line Break may be used within the Item of Definition List, Item of a Table, or in the parameter of Block Elements starting with "#".
''Inline Element''
Enclosing Inline Element with '' puts emphasis on the element (Bold font).
'''Inline Element'''
Enclosing Inline Element with ''' puts emphasis on the element (Italics).
&size(Size){Inline Elements};
&size defines the size of characters. The size must be given in pixel unit(px).
&color(color){Inline Element};
&color defines the color of any Inline Element.
%%Inline Element%%
Enclosed with %(semicolons), the Inline Element has a line through the middle of the text.
((Inline Element))
Enclosed with (( and ))(double parenthesis), the Inline Element becomes the footnote and the link to it is placed.
&ref(Attached Filename); &ref(URL of File);
You can attach a file by writing &(file name) at any place in paragraph. You can also place a hypertext link by writing #ref(URL of the file) . If the file attached or linked is an image, the image is displayed.
Page of the attachment file
nolink
Substitute Strings
&aname(Anchor Name);
&aname makes the anchor for Hyperlink. Place this code where you want to set the link target to go.
&counter; &counter(option);
&counter shows the number of access to the current page.
today
yesterday
all
&online;
&online shows the number of current accessors.
&version;
&version shows the version of current running PukiWiki.
current version = &version;
WikiName
WikiName stands for two or more Capitalized Words joined together without spaces, muti-byte characters, symbols, and numbers.
[[BracketName]]
A string enclosed with [[ and ]] makes a BracketName, which is another link style in Pukiwiki.
[[InterWikiName:PageName]]
By separating a BracketName with a colon (:), you can create an InterWiki block, which is another link style in Pukiwiki. The former part must contain an InterWikiName which is defined at InterWikiName which contains a list of defined InterWikiName. (What does this mean? It's not very clear.) The latter part must contain a WikiName or a BracketName without [[ and ]].
[[Link Name:URL]]
Create a link block by separating a BracketName with a colon (:). The former part contains the string to be used for the displayed name of a link. The latter part must contain a URL.
http://www.example.com/ https://www.example.com/ ftp://ftp.example.com/ news://news.example.com/ foo@example.com
[[Alias>PageName]]
Alias enables you to link to a page in Pukiwiki without using the same name of the linked text, as in the case of a Link Block. This is useful when referencing a portion of a given page via an anchor.
Create an Alias by separating a BracketName with the ">" symbol. The former part contains the string to used as the link's name. The latter part must contain a WikiName or a BracketName styled string without [[ and ]].
Use the following syntax to make an "anchor" to direct to a certain part of a page. When using an anchor as an internal link, you can omit the PageName:
[[Alias>PageName#anchor]] [[Alias>#anchor]]
&page;
&page; is converted to the name of current editing page.
&date; &time; &now;
&date; is converted to the current date.
&time; is converted to the current time.
&now; is converted to the current date and time.
&heart;
&heart; is recognized as a Heart Mark: &heart;
©
© is recognized as a Copyright Mark: ©
®
® is recognized as a Registered Trademark: ®
™
™ is recognized as a Trademark: ™
²
² is recognized as a 2nd power sign: ²
³
³ is recognized as a 3rd power sign: ³
³ is recognized as a space : It is mainly used for adjusting sell width of table.
&#Decimal-number; &#xHexadecimal-number;
If you insert a decimal number between &# and ; or a hexadecimal number between &# and ;, you can refer to Unicode entities. You may use this inline element to insert characters which you cannot directly type with your keyboard.
Take a look at the examples in the following table:
Special entity | Code | Comments |
世 | 世 | You can use characters from all over the world! |
♂ | ♂ | It is a man's world. |
☿ | ♀ | But it would be nothing without a woman. |
∞ | ∞ | We could go on like this forever... |
Ω | Ω | But here it must end. |
For example,
&t;
&t; is recognized as TAB Code.
Usually,TAB code can't be written from the keyboard typing in any FORM.*1 But, &t; is converted to TAB Code when the page is stored.
// Comments
The line began with // at the first column means the comment line. It won't be displayed in the pursed page.
Block Element | can contain other block elements | can be contained by other block elements |
Paragraph | no | yes |
Preformatted | no | yes |
Headings | no | no |
Table | no | yes |
Table(CSV) | no | yes |
List(unordered) | yes* | yes |
List(ordered) | yes* | yes |
Quote | yes*² | yes |
Horizontal Line | no | yes |
LEFT:/CENTER:/RIGHT: | no | yes |
#ref | no | yes |
#contents | no | yes*³ |
#comment | no | yes*³ |
#pcomment | no | yes*³ |
#article | no | yes*³ |
#vote(choice1,choice2,...) | no | yes*³ |
* As long as the beginning of Child Element is Inline Element or Paragraph, you can insert a Block Element to the next line. (Please refer to "Nesting Element" for an example.)
*²When Quotation is a Child Element of another Quotation, you need to increase the indentation level by 1.
*³ Due to Pukiwiki's default setting of left margin, this is not recommended.
Here is a section to explain the differences between WikiName, BracketName, InterWiki, Link, and Alias.
As you know by now, all of them are used in Pukiwiki to make a link to a page. And the difference betweem them is whether or not you can use spaces, multibyte-characters, symbols, and numbers. Thus, a BracketName would be a better choice if you want to avoid the typical WikiName capitalized link style. Usually, all Capitalized strings will be shown as a link. However, you can disable WikiNames in pukiwiki.ini.php if you think they are annoying.
These styles are very similar, so they might be confusing. But each of them has its own purpose. If you understand the differences, they are all very useful.
[[pukiwiki:Use PukiWiki]]............................................[a] [[whatever u like:http://pukiwiki.sourceforge.jp/?Use%20PukiWiki]]...[b] [[Another Name>Text Formatting Rule]]................................[c]
[a] is an InterWiki styled link. [b] is a Link styled link. Both of them will direct us the same page: http:pukiwiki.sourceforge.jp/?Use%20PukiWiki . This is so, because pukiwi is defined in the InterWikiName as follows:
[http://pukiwiki.sourceforge.jp/? pukiwiki] utf8
Thus InterWiki combines two pieces of information. The first piece is a URL defined in InterWikiName, and the other is the information provided by the right side attribute. InterWikiName is a kind of short cut. You can define any URL for an InterWikiName.
For example, when you create an link to external/internal wiki page, it is annoying to have to type the whole URL each time you want to use it. In this case, as an alternative, you can define an InterWikiName.
As you can see, [c] is a Alias styled link. You can use it to display a different link text for a link to a page in PukiWiki.
In conclusion, the most important difference you need to understand is Which side is which?
Link Style | Left Side | Right Side |
InterWiki | InterWikiName(Defined URL) | Additional URL |
Link | Link text | Real URL |
Alias | Link text | Real URL(WikiName/BracketName) |
~This is the paragraph, which is the parent element that contains the emphasized. ''This is the emphasized text that is the child element of the paragraph element.''
This is the paragraph, which is the parent element that contains the emphasized. This is the emphasized text that is the child element of the paragraph element.
Level[0] >Quotation Level[1]AAA >Quotation Level[1]BBB >>Quotation Level[2]AAA >>Quotation Level[2]BBB >>>Quotation Level[3] -Child Element-List Level[1] |TABLE|ELEMENT|NEXT|to|inline|element|in list| --Child Element-List Level[2] &br;Line Break in a Element ---Child Element-List Level[3] --Child Element-List Level[2] ---Child Element-List Level[3] >Quotation Level[1] >>Quotation Level[2] <<Get out of the Quotation Level2 Element >>>Quotation Level[3]AAA >>>Quotation Level[3]BBB -Child Element-List Level[1] --Child Element-List Level[2] ---Child Element-List Level[3]
Quotation Level[1]AAA
Quotation Level[1]BBB
Quotation Level[2]AAA
Quotation Level[2]BBB
Quotation Level[3]
- Child Element-List Level[1]
TABLE ELEMENT NEXT to the Inline element in a list
- Child Element-List Level[2]
Line Break in a Element
- Child Element-List Level[3]
- Child Element-List Level[2]
- Child Element-List Level[3]
Quotation Level[1]
Quotation Level[2]
Get out of the Quotation Level2 Element
Quotation Level[3]AAA
Quotation Level[3]BBB
- Child Element-List Level[1]
- Child Element-List Level[2]
- Child Element-List Level[3]