FormatRule


Total: 8087 / Today: 1 / Yesterday: 1

Text Formatting Rules

@contents

The input text of PukiWikiis 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?Elements

First of all, let's describe the "world" of PukiWiki. PukiWikitreats 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 Elementsonly consist of a part of a text block. In essence, the difference between Block Elements and Inline Elements is as follows:

  • A Block Element:
    • Can contain other Block and Inline Elements.
    • Can be the Child Element of another Block Element.
  • An Inline Element:
    • Is always the Child Element of another Element.
    • *Can* contain other Inline Elements as its Child Elements.
    • *Cannot* contain other Block Elements as its Child Elements.

Next, we'll decribe the two different kinds of elements in detail.

#block?Block Elements

  • A Block Element can contain other Block Elements and Inline Elements as its Child Elements. However, a Paragraph, a Heading, a Horizontal Line, and a #(PluginBlock?) cannot contain other Block Elements as their Child Elements.
  • As we said before, an empty line after a Block Element closes all the Child Elements and Block Elements above at once.
  • Block Elements can be Child Elements of other Block Elements.
    • List and Quotation Elements can contain other Block Elements as their Child Elements. Block Elements in Child Elements inherit the indent level of its Parent Element. As always, an empty line ends the Block Element.
    • List and Quotation have three levels of depth, which are all independent. So, if you want to contain a List Element in a Quotation Element, or a Quotation Element in a List Element, you don't need to increase the indentation level of the Parent Element.

      But if you want to contain a List Element in another List Element, or Quotation in another Quotation as its Child Elements, you need to increase the indentation level of Parent Element.

      It may seem difficult explained like this, but it's probably more simple than it seems. Please check "Nesting Elements" for concrete examples.
  • "<","<<",and "<<<" enable you to close a Quotation in a Child Element without closing the Parent Element it belongs to.
    • "<" lets you get out of the Quotation Level1 Element.
    • "<<" lets you get out of the Quotation Level2 Element.
    • "<<<" lets you get out of the Quotation Level3 Element.
  • Empty Line closes not only the Quotation Element but also the Block Element it belongs to.
  • # indicates the beginning of Plugin Block. (Plugin has 2 modes:Block and Inline.)

#paragraph?Paragraph

Inline Elements

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

  • The first line of a Paragraph and a Paragraph in a Definition List are indented. But neiher a List nor a Quotation are indented.
  • Each Paragraph continues until the appearance of a new Block Element.
  • Paragraphs *can* be Child Elements of other Block Elements.
  • Paragraphs *cannot* contain other Block Elements as its Child Elements.

#quotation?Quotation

>Inline Element

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

  • A Quotation can contain other Block Elements as its Child Elements.
  • As with all Block elements, a Quotation continues until the next empty line.
  • A Paragraph in a Quotation continues until the beginning of another Quotation or Block Element.
  • Quotations can be Child Elements of Other Block Elements. (Look at Nesting Elements for concrete examples.)
    • When Quotation is a Child Element of another Quotation, you need to increase the inentation level by 1.
    • When Quotation is a Child Element of List, you don't need to increase the indentation level.
  • When Quotation contains List as its Child Element, you don't need to increase the level.
  • If you want to close a Quotation in a List, and keep the List Element opened, you have to start a Quotation Element with "<","<<","<<<" instead of ">",">>",">>>".
  • "<","<<",and "<<<" enable you to close Quotation in List without closing the List it belongs to.

#lists?List

-Inline Element

At the beginning of a line,"-" indicates the beginning of an Unordered List. Unordered lists have three levels, namely:"-", "--", and "---".

  • Unordered List may be contained by anoother Block Elements.
  • Increase the level by one when it is contained by other List. If it is contained by a Quotation, you do not have to increase the indentation level.
  • Unordered List may contain a Paragraph by writing "~" right after "-".
  • Unordered List may contain another Block Element by writing it in the next line *as long as the beginning of Child Element is Inline Element or Paragraph* .
+Inline Element

At the beginning of a line, "+" indicates the beginning of Numbered List. Numbered List has three levels namely:"+", "++", and "+++".

  • Numbered List may be contained by another Block Elemnt.
  • Increase the level by one when it is contained by other List. If it is contained by a Quotation, you do not have to increase the indentation level.
  • Numbered List may contain a Paragraph by writing "~" right after "+".
  • Numbered List may contain another Block Element by writing it in the next line *as long as the beginning of Child Element is Inline Element or Paragraph* .
: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.

  • Definition List must have "|" in the line.
  • Item and Item's Definition must be an Inline Element.
  • Definition List may be contained by another Block Element.
  • Increase the indentation level by one when it is contained by other List. If it is contained by a Quotation, you do not have to increase the indentation level.
  • Definition List may contain a Paragaph by writing "~" right after "|".
  • Definition List may contain other Block Elements by writing a Block Element in the line right after the Definition List.

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

  • Preformatted Text can be the Child Element of other Block Elements.
  • Preformatted Text cannot contain other Block Elements as its Child Element.
  • Preformatted Text Elements will never be parsed by PukiWiki. Thus its contents are displayed "as is".

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

  • Incorrect
    AAAA|BBB|CCC|DDD
  • Correct
    |AAA|BBB|CCC|DDD|
AAABBBCCCDDD
  • The following codes can be used in conjunction with a table. They are placed at the beginning of the Child Element, and yield three posible text alignments.
    LEFT:
    CENTER:
    RIGHT:
    BGCOLOR(colorcode):
    COLOR(colorcode):
    SIZE(unit:px):
    • These codes determine how and where Child Elements should be displayed. The default setting is Left
      bbbbbbbbH E A D
      aaaaafootaaaaa
      Here is a Sampleregarding to the placementsof elements in each cell
      Flush LeftCenteredFlush Right
      Flush RightFlush LeftCentered
      rowapnBLUERED
      ~>colspan
  • "c" at the end of the line indicates the line to be Formatting Row. The following code may be used in the Formatting Row.
    LEFT:
    CENTER:
    RIGHT:
    BGCOLOR(colorcode):
    COLOR(colorcode):
    SIZE(unit:px):
    • By using these specific numbers, you can assign an exact width (in px units) to a cell.
  • "h" at the end of the line indicates the line to be the Header Row (thead).
  • "f" at the end of the line indicates the line to be the Footer Row (tfood).
  • Cell containing Inline Element starting with "~" indicates the Cell to be a Header Cell (th).
  • Cell containing only ">" will be concatenated with the Cell right next to it (colspan).
  • Cell containing only "~" will be concatenated with the Cell above it (rowspan).
  • Table may be contained by another Block Element.
  • As a general rule, a Table may not contain other Block Element.

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

  • You may enclose Inline Elements with Double Quotation ("), which enables you to contain comma(,) in Inline Elements.
  • In the Inline Elements enclosed by Double Quotation ("), you may write two consecutive Double Quotations ("") to express Inline Element containing a Double Quotation (").
  • Two consecutive Equal Signs (==) in the place of Inline Element indicates colspan.
  • More than one white space on the left of Inline Element makes it right aligned; more than one white space on both right and left sides of Inline Element makes it center aligned.

,aaaaaaaaa,bbbbbbb,ccccccc,left , center , right,==,&lt;-- colspan, test

  • CSV Style Table may be contained by another Block Element.
  • CSV Style Table may not contain other Block Elements.

#headline?Heading

*Inline Element

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

  • Heading may not be contained by other Block Elements.Heading closes other Block Elements.
  • Heading may not contain other Block Elements.

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

  • Table of Contents should not be contained by other Block Elements. Although Table of Contents may be contained by other Block Elements, left margin is set, assuming it is placed at the top-level.
  • Table of Contents may not contain other Block Elements.

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

  • All three Elements may be contained by other Block Elements.
  • All three Elements may not contain other Block Elements.
    ----
    Four "-" placed at the beginning of a line are shown as a Horizon Line.
  • Horizontal Line may not be contained by other Block Elements. Horizontal Line terminates other Block Elements.
  • Horizontal Line may not contain other Block Elements.

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

  • You can specify certain parameters by demarcating them with commas. When unspecified, the default values are used.
    Page of the attachment file
    • You can specify the page name of the attachment file. The name may be in WikiName or BracketName. When unspecified, the current page serves as the default.
    • The following parameters can be specified immediately after the page name.
      left
      center
      right
    • It specifies where to place the link or the image within the page. Center is the default.
      wrap
      no wrap
    • Specifies if the link or the image should be placed in a box. The default is to use no box.
      around
    • Specifies if the text should wrap around the link or image. No wrapping by default.
    • If you want to stop the wrapping, you can use "#img(,clear)".
      nolink
    • Nolink overrides and eliminates the default linking to the attached file.
      Substitute Strings
    • You can display a Substitute Strings instead of a file name and images. When unspecified, the file name is used by default.
    • The Substitute Strings accept only String Inline Elements. WikiName, BracketName, and other things will be interpreted as a String.
    • This option must be stated as the last parameter when you use this option.
  • #ref may be contained by other Block Elements.
  • #ref may not accept other Block Element as a Child Element.

#form?Form

#comment

"#comment" at the beginning of the line embeds a form to post comments.

  • #comment should not be contained by other Block Elements. Although #comment may be contained by other Block Elements, left margin is set, assuing it is placed at the top-level.
  • #comment may not accept other Block Elments as Child Element.
#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.

  • #pcomment should not be contained by other Block Elements. Although #pcomment may be contained by other Block Elements, left margin is set, assuing it is placed at the top-level.
  • #pcomment may not accept other Block Elements as Child Element.
#article

"#article" at the beginning of the line embeds a simple forum.

  • #article should not be contained by other Block Elements. Although #article may be contained by other Block Elements, left margin is set, assuing it is placed at the top-level.
  • #article may not accept other Block Elements as Child Element.
#vote(Option1,Option2,...)

"#vote" at the beginning of the line embeds a simple form for voting.

  • The options may contain string, WikiName, BracketName, InterWiki, and link. Other Inline Elements may not be included as an option.
  • #vote should not be contained by other Block Elements. Although #vote may be contained by other Block Elements, left margin is set, assuing it is placed at the top-level.
  • #vote may not accept other Block Elements as Child Element.

#inline?Inline Elements

  • Inline Element must be contained by a Block Element.
    • If the parent Block Element is not explicitly specified at the beginning of the line, Inline Elements is silently contained by a Paragraph.
    • If the parent Block Element is explicitly specified at the beginning of the line, Inline Elements is contained by the Block Element.
  • Inline Element may accept other Inline Elements as a Child Element.
  • Inline Elements follow the &foobar; format (user-defined format).

#string?Strings

Strings

Strings are an Inline Element.

  • Strings may be contained by other Inline Elements.
  • Strings may not accept other Inline Elemnts as a Child Element.

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

  • End of Line voids any Block Element specified at the beginning of the next line, and turns it into a String.
  • End of Line may not be contained by other Inline Elements.
  • End of Line may not accept other Inline Elements as a Child Element.
  • End of Line may not be used within the Item of Definition List, Item of a Table, or in the parameter of Block Elements starting with "#".
&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 "#".

  • Line Break may not be contained by other Inline Elements.
  • Line Break may not accept other Inline Elements as a Child Element.

#emphasis?Emphasis

''Inline Element''

Enclosing Inline Element with '' puts emphasis on the element (Bold font).

  • Emphasis (Bold) may be contained by other Inline Elements.
  • Emphasis (Bold) may accept other Inline Elements as a Child Element.
'''Inline Element'''

Enclosing Inline Element with ''' puts emphasis on the element (Italics).

  • Emphasis (Italics) may be contained by other Inline Elements.
  • Emphasis (Italics) may accept other Inline Elements as a Child Element.

#size?Font Size

&size(Size){Inline Elements};

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

  • Font Size may be contained by other Inline Elements.
  • Font Size may accept other Inline Elements as a Child Element.

#color?Font Color

&color(color){Inline Element};

&color defines the color of any Inline Element.

  • The color of characters are defined as any of following format.
    • color keyword?
    • #Hexadecimal number 6 figures
    • #Decimal Number 3 figures
  • Font Color can be a Child Element of other Inline Elements.
  • Font Color can contain other Inline Elements as its Child Elements.

#delete?Deletion Line

%%Inline Element%%

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

  • Deletion Line can be a Child Element of other Inline Elements.
  • Deletion Line can contain other Inline Elements as its Child Elements.

#note?Footnote

((Inline Elemnet))

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

  • Footnote can be a Child Element of other Inline Elements. Mother element effects to the link, not to the footnote.
  • Footnote contain other Inline Elements as its Child Elements. Child Element effects to the footnote.

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

  • You can specify certain parameters by demarcating them with commas. When unspecified, the default values are used.
    Page of the attachment file
    • You can specify the page name of the attachment file. The name may be in WikiName or BracketName. When unspecified, the current page serves as the default.
    • The following parameters can be specified immediately after the page name.
      nolink
    • Nolink overrides and eliminates the default linking to the attached file.
      Substitute Strings
    • You can display a Substitute Strings instead of a file name and images. When unspecified, the file name is used by default.
    • The Substitute Strings accept only String Inline Elements. WikiName, BracketName, and other things will be interpreted as a String.
    • This option must be stated as the last parameter when you use this option.
  • &ref may be contained by other Block Elements.
  • &ref may not contain other Block Elements as Child Elements.

#anchor?Anchor

&aname(Anchor Name);

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

  • Anchor Name must be written by ascii characters(alphabets, numeric characters, hyphnation and underscore) and be started by alphabets.
  • Anchor Name may not contain 2-byte characters,space and symbols .
  • Anchor may be contained by other Inline Elements.
  • Anchor may not accept other Inline Elemnts as a Child Element.

#counter?Counter

&counter;
&counter(option);

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

  • You can specify following parameter as option. When unspecified, the values *all* are used by default.
    today
    • Show the number of access in Today.
      yesterday
    • Show the number of access in Yesterday.
      all
    • Show the amount of access.
  • Counter may be contained by other Inline Elements.
  • Counter may not accept other Inline Elements as a Child Element.

#online?Online Viewer

&online;

&online shows the number of current accessors.

  • Online Viewer may be contained by other Inline Elements.
  • Online Viewer may not accept other Inline Elemnts as a Child Element.

#version?Version

&version;

&version shows the version of current running PukiWiki.current version = / deprecated plugin:"version" param: body: /


Last Modified: 2005-04-11 01:57:45