From KKnd'sPmWiki
Pm Wiki Zh Cn Utf 8: Wiki Styles
WikiStyles allow an author to modify the color and other attributes of text that follow. A style specification such as
%red%
will cause the following text to be displayed as red until the end of the line or the next pair of percent signs. For example:
%red% This text is red and %blue% this text is blue %% but
this text is normal.
gives
-
- This text is red and this text is blue but this text is normal.
WikiStyles(Wiki样式)允许作者修改文本的颜色和其它属性。比如,
%red%
标签会使得下面的文本显示成红颜色直到一行结束或者下一个百分号对出现。
比如:
%red% This text is red and %blue% this text is blue %% but
this text is normal.
显示如下:
-
- This text is red and this text is blue but this text is normal.
The set of predefined
WikiStyles is customizable by the
WikiAdministrator. Most
PmWiki systems define %newwin% to cause links to open in a new window (
example), and standard text colors such as %black%, %white%, %red%, %green%, %blue%, etc.
预先定义的
WikiStyles集是由
WikiAdministrator定制的。大多数
PmWiki系统定义%newwin%为在一个新的窗口打开链接(
example), 标准的颜色标签有%black%, %white%, %red%, %green%, %blue%, etc.
Creating new styles
Placing
color
,
bgcolor
, or
target
specifications inside of a pair of percent signs will change the style of the following text to use those colors up to the end of a line or until the next pair of percent-signs. For example:
%color=red% This text is red and %color=blue% this text
is blue %% but this text is normal.
renders as
-
- This text is red and this text is blue but this text is normal.
创建一个新的样式
把
color
,
bgcolor
和
target
标签,放到一对百分号对之间可以用来改变后面的文本的颜色,直到一行结束或者下一个百分号对。
举例:
%color=red% This text is red and %color=blue% this text
is blue %% but this text is normal.
显示如下:
-
- This text is red and this text is blue but this text is normal.
One can also change the background color using the
bgcolor
attribute:
%color=white bgcolor=green% This text is white on green %color=green% and
this is green on white.
-
- This text is white on green and this is green on white.
你可以通过使用
bgcolor
属性来改变文本背景颜色:
%color=white bgcolor=green% This text is white on green %color=green% and
this is green on white.
-
- This text is white on green and this is green on white.
Finally, one can specify that links should open in a new window via the
target
attribute:
%target=_blank% Any links on this line like http://www.pmichaud.com
will open in a new window.
which gives
-
- Any links on this line like http://www.pmichaud.com will open in a new window.
最后,你还可能通过
target
属性来指定一个链接在一个新的窗口中打开:
%target=_blank% Any links on this line like http://www.pmichaud.com
will open in a new window.
which gives
-
- Any links on this line like http://www.pmichaud.com will open in a new window.
Style definitions
样式定义
Wiki authors can also make their own
WikiStyle definitions within a document using the
define
attribute. For example, the statement
%define=hotpink color=#ff69b4%
will cause the markup
%hotpink%
to be a shortcut for
%color=#ff69b4%
(
like this). One can specify multiple items in a definition, as in
%define=reverse color=white bgcolor=black%
which allows
%reverse%
to cause
reverse video, and
%reverse hotpink%
to be the
combination of both shortcuts.
Wiki的作者可以在一个文档中通过使用
define
来指定自己的WikiStyle
?。举例:
%define=hotpink color=#ff69b4%
将会使
%hotpink%
成为
%color=#ff69b4%
的缩写(
像这种的颜色). 你还可以在一个定义中指定多个选项,比如:
%define=reverse color=white bgcolor=black%
那么标签
%reverse%
会形成这样的效果:
reverse video,
%reverse hotpink%
标签会形成这样的效果:
combination of both shortcuts.
It's often a good idea to put common style definitions into
GroupHeaders so that they can be shared among multiple pages in a group. Or, the
WikiAdministrator can predefine styles as a
LocalCustomization -- see WikiStylesAdmin
?.
你可以把一些公用的样式定义放到
GroupHeaders中,那样所有的组内页面都公用相同的样式表。或者
WikiAdministrator能够预先定一些样式作为
LocalCustomization (参见WikiStylesAdmin
?)
Trans. By LongWoSion
<<
TextFormattingRules |
PmWikiZhCnUtf8.DocumentationIndex |
InterMap >>
Retrieved from “http://xemacs.cosoft.org.cn/pmwiki/pmwiki.php/PmWikiZhCnUtf8/WikiStyles”
Page last modified on 18 九月, 2003, 时间 16:29
©
copyleft by [email protected]
or
[email protected]