Wiki Styles China
authors (basic)
Wikistyle basics
WikiStyleså…许作者修改页é¢å†…容(如文å—)的颜色或其它属性.Wikistyleä½¿ç”¨ç™¾åˆ†æ¯”ç¬¦å·æ‰€å†™æˆï¼Œä¾‹å¦‚%red%
或者是%bgcolor=blue%
.
最基本的wikistylesæ˜¯æ”¹å˜æ–‡å—属性,例如文å—颜色ã€èƒŒæ™¯é¢œè‰²ä»¥åŠå—型。PmWiki å®šä¹‰äº†æ•°ç§æ”¹å˜æ–‡å—颜色的方法%black%, %white%, %red%, %yellow%, %blue%, %gray%, %silver%, %maroon%, %green%, %navy%, and %purple%。
篮å里有%red%苹果,%blue%è“苺,%purple%茄å,%green%æ¥å§†æžœ ,%%以åŠå…¶å®ƒæ°´æžœ. |
篮å里有苹果,è“苺,茄å,æ¥å§†æžœ ,以åŠå…¶å®ƒæ°´æžœ. |
对於未定义å称的颜色,必须使用%color=...%
è¿™æ ·çš„æ ¼å¼ï½¡(注:为é¿å…与WikiWord?æ··æ·†,RGB颜色(#rrggbb)定义务必使用å°å†™å—æ¯.)
我也想æ¥ç‚¹%color=#ff7f00%æ¡”å%%! |
我也想æ¥ç‚¹æ¡”å! |
使用%bgcolor=...%
æ¥è®¾å®šèƒŒæ™¯é¢œè‰²:
这个å¥å有%bgcolor=green yellow%绿底黄å—的设定. |
这个å¥å有绿底黄å—的设定. |
See PmWiki:WikiStyleColors for more color help.
Scopes
Wikistyleså¯ä»¥è®¾å®šå¥—用的scope;倘若ä¸è®¾å®šscope,åˆ™æ ·å¼ä¼šä¸€ç›´ç”Ÿæ•ˆ,ç›´åˆ°ä¸‹ä¸€ä¸ªæ ·å¼å®šä¹‰,或者到达段è½ç»“å°¾ï½¡ä½¿ç”¨æ—¶åœ¨æ ·å¼å®šä¹‰å‰åŠ ä¸ŠèŒƒå›´ä¿®é¥°å—å³å¯.例如套用到整个段è½(%p ...%
),整份清å•(%list ...%
),清å•项目(%item ...%
)以åŠä»»ä½•的区å—(%block ...%
).scope用"apply="æ¥é¢„定义, 具体è§below.
%p bgcolor=#ffeeee%æ®µè½æœ€å‰é¢çš„æ ·å¼å®šä¹‰ä¼šå¥—用在整个段è½å†…容上,å³ä½¿é‡Œå¤´åˆå®šä¹‰äº†%blue%å…¶å®ƒçš„æ ·å¼%%. |
æ®µè½æœ€å‰é¢çš„æ ·å¼å®šä¹‰ä¼šå¥—用在整个段è½å†…容上,å³ä½¿é‡Œå¤´åˆå®šä¹‰äº†å…¶å®ƒçš„æ ·å¼. |
>>style<<
区å—èƒ½å°†æ ·å¼å¥—用到自定范围的页é¢å†…容ä¸ï½¡æ ·å¼åŒºå—会一直作用直到下一个>><<
.
>>blue font-style=italic bgcolor=#ffffcc<< ä¸Šä¸€è¡Œå¾Œæ‰€æœ‰å†…å®¹çš„æ ·å¼çš†ä¸ºè“色斜体å—, 包括了 é¢„å…ˆæ ¼å¼åŒ–æ–‡å— * æ¸…å• -> 缩进项目 >><< |
ä¸Šä¸€è¡Œå¾Œæ‰€æœ‰å†…å®¹çš„æ ·å¼çš†ä¸ºè“色斜体å—, 包括了 é¢„å…ˆæ ¼å¼åŒ–æ–‡å—
缩进项目
|
Wikistyle attributes
The style attributes recognized within a wikistyle specification are:
------------ CSS ------------- --HTML-- color bgcolor class background-color margin id text-align padding hspace text-decoration border vspace font-size float target font-family list-style rel font-weight width* accesskey font-style height* value display Special: define, apply
The attributes in the first two columns correspond to the cascading style sheet (CSS) properties of the same name. The attributes in the last column apply only to specific items:
class=
andid=
assign a CSS class or identifier to an HTML elementtarget=name
opens links that follow in a browser window called "name"rel=name
in a link identifies the relationship of a target pageaccesskey=x
uses 'x' as a shortcut key for the link that followsvalue=9
sets the number of the current ordered list item
* The width and height attributes have asterisks because they are handled specially for <img .../> tags. If used by themselves (i.e., without anything providing an "apply=" parameter to the wikistyle), then they set the 'width=' and 'height=' attributes of any <img ... /> tags that follow. Otherwise, they set the 'width:' and 'height:' properties of the element being styled.
Applying wikistyles to blocks
Normally a wikistyle applies to a span of (inline) text, but the apply= attribute allows a style to be applied to something else. The predefined apply= values are:
apply=img | apply the style to any image that follows | |
apply=p | apply the style to the current paragraph | * |
apply=pre | apply the style to the current preformatted text | |
apply=list | apply the style to the current list | * |
apply=item | apply the style to the current list item | * |
apply=div | apply the style to the current div | |
apply=block | apply the style to the current block, whether it's a paragraph, list, list item, heading, or division. | * |
The starred items also have wikistyle shortcuts already defined,
thus %p color=blue%
is the same as %apply=p color=blue%
, and
%list ROMAN%
is the same as %apply=list list-style=upper-roman%
.
Some wikistyle shortcuts also make use of apply, thus %right%
is a shortcut for %text-align=right apply=block%
.
An applied wikistyle will only take effect if it's on the line that starts the thing it's supposed to modify. In other words, a wikistyle in the third markup line of a paragraph can't change the attributes of the paragraph:
here is some text in a paragraph and if we try to %apply=p color=blue% change the color of the paragraph in the middle it won't work because the style comes after the paragraph has already been started. |
here is some text in a paragraph and if we try to change the color of the paragraph in the middle it won't work because the style comes after the paragraph has already been started. |
However, this %p color=red% paragraph ''will'' be in red because its block style does occur in the first line of its text. |
However, this paragraph will be in red because its block style does occur in the first line of its text. |
* Here's a list item * %list red% Oops, too late to affect the list! |
|
Enabling Styles
Styles not listed above can be enabled by a PMWiki Adminstrator by modifying the local/config.php file. For instance to enable the "line-height" style attribute add the line
$WikiStyleCSS[] = 'line-height';
to the local/config.php file.
Custom style shortcuts
define=
属性å¯ç”¨æ¥ä¸ºä»»ä½•wikiæ ·å¼å®šä¹‰å‘½ä¸€ä¸ªç¼©å†™ã€‚之åŽçš„æ–‡ç« 使用这个缩写,å³å¯é‡è¦†åˆ©ç”¨è¿™ä¸ªæ ·å¼å®šä¹‰ã€‚
%define=box block bgcolor=#ddddff border="2px dotted blue"% %box% [@ $ echo "Hello world" Hello World $ exit @] %box font-weight=bold color=green% [@ $ echo "I said, HELLO" @] |
$ echo "Hello world" Hello World $ exit $ echo "I said, HELLO" |
Tip: å°†å¸¸ç”¨çš„æ ·å¼ç¼©å†™é›†ä¸æ”¾åœ¨Group Header?页é¢ä¸ï¼Œä»¥ä¾¿ç¾¤ç»„里头所有的页é¢éƒ½èƒ½åˆ©ç”¨è¿™äº›ç¼©å†™ã€‚wiki administrator?å¯ä»¥åœ¨local customization?å…ˆå®šä¹‰ä¸€äº›å¥—ç”¨äºŽæ•´ä¸ªç³»ç»Ÿçš„æ ·å¼ç¼©å†™ï¼ˆè¯¦è§CustomWikiStyles?)
Tip: æ ·å¼ç¼©å†™åº”å‘½åæˆæœ‰æ„义的å—è¯ï¼Œè€Œä¸æ˜¯ç›´æŽ¥ç”¨é¢œè‰²åå—。比如说如果è¦å‘Šè®¯æ¯è¦ç”¨ç»¿è‰²å—,则设定缩写为%define=warn green%
,并使用%warn%
æ¥å¥—用è¦å‘Šæ ·å¼ï¼Œè€Œéžä½¿ç”¨%green%
ã€‚ä¹‹å¾Œè‹¥å†³å®šå˜æ¢è¦å‘Šæ ·å¼ï¼Œåˆ™åªè¦ä¿®æ”¹%define=warn green%
,所有%warn%
就会跟ç€å˜æ¢ã€‚è¿™æ ·æ¯”èµ·ä¸€ä¸ªä¸€ä¸ªæ¢æŽ‰%green%
æ¥å¾—容易多了
Tip: Any undefined WikiStyle is automatically treated as a request for a class, thus %pre%
is the same as saying %class=pre%
.
Predefined style shortcuts
PmWikié¢„å…ˆè®¾å®šäº†ä¸€äº›æ ·å¼ç¼©å†™
- æ–‡å—颜色: black, white, red, yellow, blue, gray, silver, maroon, green, navy, purple (用
%color=...%
) - 坹齿–¹å¼:
%center%
和%right%
- å›¾ç‰‡ä¸Žæ ¼å
- å‘峿µ®åЍã€å‘左浮动:
%rfloat%
和%lfloat%
- 框架项目:
%frame%
,%rframe%
, 和%lframe%
- 缩略图:
%thumb%
- å‘峿µ®åЍã€å‘左浮动:
- 在新窗å£ä¸æ‰“å¼€:
%newwin%
(使用%target=_blank%
) - 注释:
%comment%
(使用%display=none%
) - 有åºåˆ—表:
%decimal%
,%roman%
,%ROMAN%
,%alpha%
,%ALPHA%
(å‚ç…§ Cookbook:OutlineLists)
Examples
WikiStyleExamples页颿œ‰è®¸å¤šwikiæ ·å¼çš„使用范例.
Known Issues
- åœ¨æ ·å¼å®šä¹‰ä¸ï¼Œç™¾åˆ†æ¯”符å·ï¼ˆ%ï¼‰æ— æ³•æ£ç¡®ä½œç”¨ï¼ˆä¾‹å¦‚:
%block width=50% %
需è¦ä½¿ç”¨ "pct" æ¥ä»£æ›¿ "%".
See Also
<< | Documentation Index? | >>