Main.SideBar (edit)PmWiki |
PmWiki continues to use WikiStyles as a mechanism for styling text with color and other attributes. However, PmWiki 2.0 introduces the ability to control the styling further and to even place styles on blocks. The basics of WikiStyles are the same as before--essentially a style is specified within a pair of %-signs and styles the text that follows, as in: This text is %color=red% red, %color=blue% blue, %% and normal (black). This text is red, blue, and normal (black). There are a wide number of available style properties, borrowed primarily from HTML and CSS. In addition, an author can define a style "shortcut" by using the %color=red define=mystyle% Here is some %mystyle% red text created using a style shortcut. Here is some red text created using a style shortcut. Shortcuts can be combined with other styles, including other shortcuts: %color=red define=lovelyred% %bgcolor=yellow define=likegrapefruit% %red% This text is red, %red bgcolor=#ccc% red on a grey background, and %lovelyred likegrapefruit% red on a yellow background.
This text is red, red on a grey background, and red on a yellow background. So far, this is all basically the same as what was available in PmWiki 1.0. PmWiki 2.0 includes the capability to style blocks, by using the This entire block %apply=block bgcolor=yellow% has a yellow background, even though the `WikiStyle appears in the middle of the line. %bgcolor=pink% Other inline (non-block) WikiStyles can appear in the middle of the line,%% as before. This entire block has a yellow background, even though the WikiStyle appears in the middle of the line. Other inline (non-block) WikiStyles can appear in the middle of the line, as before. This means it's now possible to do right-aligned and centered text: %block text-align=right% The text of this paragraph is right-aligned. %block text-align=center% The text of this paragraph is centered. The text of this paragraph is right-aligned. The text of this paragraph is centered. In fact, PmWiki predefines %right% This is right-aligned. %center% This is centered. This is right-aligned. This is centered. Authors can define their own custom styles: %block bgcolor=#fdf define=Pm% %center bgcolor=#dfd border='3px dotted green' define=goofy% %right bgcolor=#ffffcc border='1px dotted red' define=rediguana% %Pm% Any text that is on a light purple background is a comment from [[~Pm]]. %goofy% Here's some text from Goofy. %rediguana% bla bla by rediguana!
Any text that is on a light purple background is a comment from Pm?. Here's some text from Goofy. bla bla by rediguana! Styles can be applied to almost any kind of block: * %block bgcolor=yellow% Here is a list item * Here's another list item * Here's more of a list # A new list
In particular, this means that outlines are now possible using the predefined # %ROMAN% Top level ## %ALPHA% second-level ## second-level ## second-level ### third-level ### third-level ## second-level ### third-level #### %alpha% fourth-level ##### %roman% fifth-level ##### fifth-level #### fourth-level # top-level # top-level
WikiStyles can be combined with CSS stylesheets to produce even more powerful markup sequences: The list below is an "outline" list: # %outline% top-level # top-level ## second-level ### third-level ## second-level ## second-level ### third-level #### fourth-level ##### fifth-level While this list is just a normal PmWiki-ordered list: # top-level ## second-level ### third-level The list below is an "outline" list:
While this list is just a normal PmWiki-ordered list:
Is the outline supposed to show as 1, 1.1, 1.1.1 and so on? In Safari, the 2 lists have the same numbering scheme. No, I just haven't figured out what to do with this one yet. The WikiStyleExamples page is part of the distributed documentation, but making it display properly would require that I add an "outline" CSS to the distribution as well (and I'm not ready to do that). So, I'm still trying to figure out where I want to go with this last one. (TODO) --Pm?
|