gotojapan.net / a Japan guide wiki with many photos



 

Formatting roles examples

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.

Elements

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 decribe the two different kinds of elements in detail.

Block Elements

Paragraph

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.

Quotation

>Inline Element

A ">" character indicates the beginning of Quotation. Quotation has 3 indentation levels, indicated by: ">", ">>", and ">>>".

List

-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 seperated by "|" in the middle. There are three indentation levels for Definition List: ":", "::", and ":::".

You may omit the Item or the Definition. You may give mutiple definitions to an item by writing a sequence of Definition List and ommiting the Item after the first one.

Preformatted Texts

"White Space" at the beginning of a line indicates the beginning of Preformatted Text. Line breaks are not automatically inserted in Prefomatted Text.

Table

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

AAABBBCCCDDD

CSV Style Table

,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.

aaaaaaaaabbbbbbbccccccc
leftcenterright
<-- colspantest

Heading

*Inline Element

A line that starts wit an "*" character becomes a Heading Element. There are three levels of heading Elements, namely: "*", "**",and "***".

Table of Contents

#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-CENTERED-RIGHT

LEFT:Inline Element
CENTER:Inline Element
RIGHT:Inline Element

Writing "LEFT:", "CENTER:", or "RIGHT:" at the beginning of the line aligns the Inline Element.

Horizontal Line

----

Four "-" placed at the beginning of a line are shown as a Horizon Line.

Embedding Files and Images

#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.

Form

#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 seperate 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.

Inline Elements

Strings

Strings

Strings are an Inline Element.

Line Breaks

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 "#".

Emphasis

''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).

Font Size

&size(Size){Inline Elements};

&size defines the size of characters. The size must be given in pixel unit(px).

Font Color

&color(color){Inline Element};

&color defines the color of any Inline Element.

Deletion Line

%%Inline Element%%

Enclosed with %(semicolons), the Inline Element has a line through the middle of the text.

Footnote

((Inline Elemnet))

Enclosed with (( and ))(double parenthesis), the Inline Element becomes the footnote and the link to it is placed.

Embedding Files and Images

&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.

Anchor

&aname(Anchor Name);

&aname makes the anchor for Hyperlink. Place a certain place where you want to set the target of Hyperlink.

Counter

&counter;
&counter(option);

&counter shows the number of access to the current page.

Online Viewer

&online;

&online shows the number of current accessors.

Version

&version;

&version shows the version of current running PukiWiki.

current version = 1.4.7

WikiName

WikiName

WikiName stands for two or more Capitalized Words joined together without spaces, muti-byte characters, symbols, and numbers.

BracketName

[[BracketName]]

A string enclosed with [[ and ]] makes a BracketName, which is another link style in Pukiwiki.

InterWiki

[[InterWikiName:PageName]]

By separating a BracketName with : , 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

[[Link Name:URL]]

By separating a BracketName with : , you can create a Link block, which is yet another link style in Pukiwiki. The former part can contain a certain string which is used for the displayed name of a link. The latter part must contain a URL.

Alias

[[Alias>PageName]]

By seperating a BracketName with > , you can creat an Alias, which is another link style in Pukiwiki. The former part can contain a certain string which is used for a name of a link. The latter part must contain a WikiName or a BracketName styled string without [[ and ]].

Alias enables you to make a link to a page in Pukiwiki with a different name.

You can also use an "anchor" to direct you to a certain part of a page. When you use an anchor as an internal link, you can omit a PageName.:|

[[Alias>PageName#anchor]]
[[Alias>#anchor]]

Entity

*Page Name Entity

&page;

&page; is converted to the name of current editing page.

*Date Entity

&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.

*Special Characters

&heart;

&heart; is recognized as a Heart Mark: &heart;

&copy;

&copy; is recognized as a Copyright Mark: ©

&reg;

&reg; is recognized as a Registard Trademark: ®

&trade;

&trade; is recognized as a Trademark: ™

&sup2;

&sup2; is recognized as a 2nd power sign: ²

&sup3;

&sup3; is recognized as a 3rd power sign: ³

&nbsp;

&sup3; is recognized as a space :   It is mainly used for adjusting sell width of table.

*Numeric Entity

&#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 entityCodeComments
&#19990;You can use characters from all over the world!
&#9794;It is a man's world.
&#9792;But it would be nothing without a woman.
&#8734;We could go on like this forever...
Ω&#937;But here it must end.

For example,

For example 、内田百&#38290; is recognized as 内田百閒.

TAB Code

 &t;

&t; is recognized as TAB Code.

Usually,TAB code can't be written from the keyborad typing in any FORM.*1 But, &t; is conveted to TAB Code when the page is stored.

Others

Comment line

// Comments

The line began with // at the first column means the comment line. It won't be displayed in the pursed page.


Prohibition

Block Elementcan contain other block elementscan be contained by other block elements
Paragraphnoyes
Prefpmattednoyes
Headingsnono
Tablenoyes
Table(CSV)noyes
List(unordered)yes*yes
List(ordered)yes*yes
Quoteyes*²yes
Horizontal Linenoyes
LEFT:/CENTER:/RIGHT:noyes
#refnoyes
#contentsnoyes*³
#commentnoyes*³
#pcommentnoyes*³
#articlenoyes*³
#vote(choice1,choice2,...)noyes*³

* 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 inentation level by 1.

*³ Due to pukiwiki's default setting of left margin, this is not recommended.


Compare Link Styles

Here is a section to explain the differences between WikiName, BracketName, InterWiki, Link, and Alias.

WikiName and BracketName

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.

InterWiki, Link, and Alias

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.

First let's focus on their grammatical styles.
[[pukiwiki:Use PukiWiki]]..........[a]
[[whatever u like:http://pukiwiki.org/?Use%20PukiWiki]]...[b]
[[Another Name>Text Formatting Rule]]......[c]

[a] is an InterWiki styled link. And [b] is a Link styled link.
Finaly, both of them will direct us the same page: http://pukiwiki.org/?Use%20PukiWiki .
This is so, because pukiwi is defined in the InterWikiName as follows:

[http://pukiwiki.org/? 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 StyleLeft SideRight Side
InterWikiInterWikiName(Defined URL)Additional URL
LinkLink textReal URL
AliasLink textReal URL(WikiName/BracketName)


Nesting Elements

Paragraph Element-Emphasize 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.''

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.

Quotation Element-List 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]
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]
    TABLEELEMENTNEXTtothe Inlineelementin 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]



*1 Pasting from Clipboard is available.