文本格式规则
这个页面提供了更多有效的PmWiki支持的Markup标记列表。 如果你需要使用,请往下看。
要练习一下这些语法规则,请到沙盒中练习,而非在本页。
段落
另起一段,只需要按回车空一行就可以了。
Words on two lines in a row will wrap and fill as needed (the normal XHTML behavior). To turn off the automatic filling, use the (:linebreaks:)
directive above the paragraph.
- 在一行结尾插入
\
(一个反斜杠) 可以将当前行加入到下一节。 - 在一行结尾插入
\\
(两个反斜杠)强制换一行。 - 在一行结尾插入
\\\
(三个反斜杠)强制换两行。 - 使用
[[<<]]
插入一个可以清空浮动元素的换行。
缩进段落 (Quotes)(引用)
使用(->
)在段落开头可以产生一个整段缩进。像这样(--->
),更多的破折号产生更大的缩进。
->从其有座山,山里有座庙,庙里有个老和尚和小和尚。老和尚在对小和尚讲故事:“从其有座山,山里有座庙,庙里有个老和尚和小和尚。老和尚在对小和尚讲故事……” |
从其有座山,山里有座庙,庙里有个老和尚和小和尚。老和尚在对小和尚讲故事:“从其有座山,山里有座庙,庙里有个老和尚和小和尚。老和尚在对小和尚讲故事……”
|
使用(-<
)可以减小段落缩进,更上面一个刚好相反,越多的破折号(像这样---<
) 缩进也越小。示例:
-<Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. |
Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.
|
--<Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. And that food would be good too. |
|
Blocks of text to which (:linebreaks:)
has been applied can be indented by preceding the first line of the block with indention arrows (->
) and aligning subsequent lines under the first. An unindented line stops the block indentation. See Cookbook:Markup Tricks for an example.
无序列表和有序列表
无序列表使用星号(*),有序列表使用井号(#):
* First-level list item ** Second-level list item ### Order this #### And this (optional) ### Then this ** Another second-level item * A first-level item: cooking ## Prepare the experiment ### Unwrap the pop-tart ### Insert the pop-tart into the toaster ## Begin cooking the pop tart ## Stand back |
|
# A list is terminated by the first line that is not a list. # Also terminate a list using the escape sequence [@[==]@] [==] # Continue a list item by lining up the text with leading whitespace. # Use a forced linebreak \\ to force a newline in your list item. |
by the first line that is not a list.
|
## Text between list items can cause numbering to restart ## %item value=3% this can be dealt with |
|
更多内容详见:PmWiki:ListStyles和Cookbook:WikiStylesPlus。
定义列表
这是一个很有用的* 新功能
When you define terms using this markup
PmWiki will recognize them as PageTextVariables?
that you can use on any page or PageList?.
* Added in PmWiki version 2.2.0
Definition lists are made by placing colons at the left margin (and between each term and definition):
:项目:项目定义 |
|
空白规则
Whitespace indentation in lists. Any line that begins with whitespace and aligns with a previous list item (whether bulleted, numbers or definitional) is considered to be "within" that list item. Text folds and wraps as normal, and the (:linebreaks:)
directive is honored.
# First-level item\\ Whitespace used to continue item on a new line # Another first-level item # Whitespace combined with a single # to create a new item one level deeper |
|
Otherwise, lines that begin with whitespace are treated as preformatted text, using a monospace font and not generating linebreaks except where explicitly indicated in the markup. Note to administrators: Starting with version 2.2.0-beta41, this feature can be modified using $EnableWSPre
. (Another way to create preformatted text blocks is by using the [@...@] markup.)
水平分隔线
使用4个或以上的破折号(----)可以在当前行插入水平分割线。
强调和字符格式
- Enclose text in doubled single-quotes (''text''), i.e., two apostrophes, for emphasis (usually italics)
- Enclose text in tripled single-quotes ('''text'''), i.e. three apostrophes, for strong (usually bold)
- Enclose text in five single-quotes ('''''text'''''), or triples within doubles (five apostrophes), for strong emphasis (usually bold italics)
- Enclose text in doubled at-signs (@@text@@) for
monospace
text - Use [+large+] for large text, [++larger++] for larger, [-small-] for small text, and [--smaller--] for smaller.
- Emphasis can be used multiple times within a line, but cannot span across markup line boundaries (i.e., you can't put a paragraph break in the middle of bold text).
- '~italic~' and '*bold*' are available if enabled in config.php
其它样式
'+大字体+', '-小字体-', '^上标^', '_下标_', {+插入文字(增加下划线)+}, {-删除文字(增加删除线)-} |
大字体, 小字体, 上标, 下标, 插入文字(增加下划线),
|
`WikiWord
WikiWord neutralisation
更多关于高级文本样式的设置,请参考Wiki样式。
资源链接
- 在页面名前后像这样 [[text formatting rules]] 增加两个方括号可以创建一个链接。
- On some PmWiki installations, capitalized words joined together (e.g., WikiWords) can also be used to make references to other pages without needing the double-brackets.
- 以"
http:
", "ftp:
", "gopher:
", "mailto:
",或"news:
" 开头的URLs地址会像 http://www.pmichaud.com/toast 这样自动显示为链接。 - URLs地址中以
.gif
,.jpg
或.png
结尾的图片链接会直接显示图片。 - Links with arbitrary text can be created as either [[target | text]] or [[text -> target]]. Text can be an image URL, in which case the image becomes the link to the remote url or WikiWord.
- 给页面增加锚点请使用
[[#target]]
。
更多链接内容。
标题
插入标题,在标题前使用感叹号(!) 。详细如下:
!! 标题2 !!! 标题3 !!!! 标题4 !!!!! 标题5 |
标题2标题3标题4标题5 |
值得注意的是,一级标题已经被用在了PmWiki的页面标题中,所以编辑的页面内容需要从H2开始。这样可能利于搜索(引擎)。
详见:Cookbook:Numbered Headers 。
Code代码
任何在[= 和=]中的内容都会被直接显示,但是段落是被重新格式化的。
要插入一段格式化过的文本内容,请在内容前后使用[@...@] 标记。它既不处理文本(通常是一段代码)中的内容,也不会重新格式化它。示例:
[@ 这是一段[[PmWiki.PmWiki]]代码 '$CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #前面是代码,我是人见人爱的注释 @] |
这是一段[[PmWiki.PmWiki]]代码 '$CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #前面是代码,我是人见人爱的注释 |
The multiline [@...@]
is a block markup, and in order to change the styling of these preformatted text blocks, you need to apply a "block" WikiStyle?.
%block blue%[@ The font color of this text is blue @] |
The font color of this text is blue |
It is also useful to use [= =]
within other wiki structures, as this enables the inclusion of new lines in text values. The example below shows how to include a multi-line value in a hidden form field.
(:input hidden message "[=Line1 Line2=]":)
注释
使用 (:一些注释内容:)
添加注释。
特殊字符
表格
表格中,一个单元格前后用两个竖线('||')包裹起来。 A cell with leading and trailing spaces is centered; a cell with leading spaces is right-aligned; all other cells are left-aligned. An empty cell will cause the previous cell to span multiple columns. (There is currently no mechanism for spanning multiple rows.) A line beginning with '||' specifies the table attributes for subsequent tables. A '!' as the first character in a cell provides emphasis that can be used to provide headings.
||border=1 width=50% ||!表格||!标题||!示例|| ||!左边 || 中 || 右边|| ||石头 ||! 大剪刀 || 布|| || || 中间是一位天使 || || || || 合并一列 |||| | |||||||||||||||
|
更多内容详见:表格高级指令。
更多内容
请看这里。