:CategoryDev/Document
PukiWiki/1.4/添付文書
../FormatRule

Japanese Version : PukiWiki/1.4/添付文書/FormattingRules


Text Formatting Rules

Most text is displayed as it is written.

Use the formatting rules below to decorate texts. For the formatting with plugins, only the most commonly used ones are explained here. See PukiWiki/1.4/Manual/Plugin for the details of the plugin options.


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

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

Preformatted Texts

"White Space" at the beginning of a line indicates the beginning of Preformatted Text. Line breaks are not automatically inserted in Preformatted 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 Rule

----

Four or more "-" placed at the beginning of a line are shown as a horizontal rule.

Line Break

#br

"#br" placed at the beginning of a line makes a line break in a block element or between block elements. *1

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.

Disabling text wraparound

#clear 

#clear placed at the beginning of the line cancels the text wraparound set in #ref. Wraparound is always cancelled at the end of the texts even without #clear.

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 sets the size of inline elements in pixels (px).

Font Color

&color(color){Inline Elements};

&color sets the color of inline elements.

Line Strikethrough

%%Inline Elements%%

Inline elements enclosed with %% makes texts with strikethrough.

Footnote

((Inline Elements))

Inline elements enclosed with (( and )) makes a footnote. A link to the footnote is created in the text. Footnotes cannot be nested.

Embedded Files and Images

&ref(File Name);
&ref(URL);

&ref makes a link to an attachment file or a URL. If the attachment is an image file, the image is displayed.

Ruby

&ruby(ruby string){Inline Elements};

&ruby makes a ruby (short runs of text alongside the base text) for inline elements. In a browser does not support a ruby, it is displayed as texts surrounded by ( ).

Anchor

&aname(anchor name);
&aname(anchor name){Inline Elements};

&aname; makes an anchor for a link.

Counter

&counter;
&counter(options);

&counter; makes a counter that displays the number of accesses to the page.

Online Viewers

&online;

&online; displays the number of current accesses.

Version

&version;

&version displays the version of PukiWiki.

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 BracketName, which is another link style in Pukiwiki.

InterWiki

[[InterWikiName:PageName]]

By seperating 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 seperating a BracketName with : , you can creat 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.

http://...
https://...
ftp://...
news://...
mailto:...

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.

*Character Entities

In addition to the character entities defined in SGML (e.g., &copy;, &reg;, etc.), the following entities can be used.

&#38;heart;
&#38;smile;
&#38;bigsmile;
&#38;huh;
&#38;oh;
&#38;wink;
&#38;sad;
&#38;worried;

*Numeric Entity

&#Decimal-number;
&#xHexadecimal-number;

By writing a decimal number between &# and ; or a hexadecimal number between &#x and ;, a Unicode character can be displayed. 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!
&#8734;We could go on like this forever...
Ω&#937;But here it must end.

Others

Commnet line

// Comments

A line beginning with // is a comment. It is not displayed on the wiki 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 it's 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.sourceforge.jp/?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.sourceforge.jp/?Use%20PukiWiki . This is so, because pukiwi is defined in the InterWikiName as followins:

[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 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]

(The texts below are for the discussion in the translation team. Don't worry if it's written in Japanese:)


Translation patterns


*1 #br placed right after an empty line next to a block element makes a line break that separates blocks. #br placed right after a block element makes a line break inside that block element. Unlike a line break in a wiki text, #br preserves the format of the line following it.

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2009-05-25 (月) 14:10:00
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.315 sec.

SourceForge