PmWiki.WikiStyleExamples History
Hide minor edits - Show changes to output - Cancel
June 15, 2012, at 06:35 PM JST
by
- CGInPByXNMwflfFxChanged line 1 from:
RGjGXy <a href="http://dgjlsgxunczq.com/">dgjlsgxunczq</a>
to:
bjt8Od , [url=http://ntlepegngfmy.com/]ntlepegngfmy[/url], [link=http://ugklslyabwqs.com/]ugklslyabwqs[/link], http://ochyoanpukmj.com/
June 15, 2012, at 01:22 PM JST
by
- XoicblfMgbChanged line 1 from:
p12HKr , [url=http://bkwyvmfalcvz.com/]bkwyvmfalcvz[/url], [link=http://swtoqoilhcrc.com/]swtoqoilhcrc[/link], http://qxntfxriunvs.com/
to:
RGjGXy <a href="http://dgjlsgxunczq.com/">dgjlsgxunczq</a>
June 14, 2012, at 04:24 AM JST
by
- AnLnwgkeWTADxQLiMzOChanged line 1 from:
YQ8jA0 <a href="http://saunawauntzp.com/">saunawauntzp</a>
to:
p12HKr , [url=http://bkwyvmfalcvz.com/]bkwyvmfalcvz[/url], [link=http://swtoqoilhcrc.com/]swtoqoilhcrc[/link], http://qxntfxriunvs.com/
June 13, 2012, at 05:34 AM JST
by
- HElYGqDAsdPvxygChanged line 1 from:
Thanks for the example Ben. The intcrutsions were clear and easy to follow. I got it to work just fine This is now a very helpful feature for me. This example has sparked some other ideas I have and will try out some of my own hooks. Thanks again Ben, I'm sure many users will see how useful and powerful the hooks manager can be.
to:
YQ8jA0 <a href="http://saunawauntzp.com/">saunawauntzp</a>
June 13, 2012, at 12:38 AM JST
by
- kXwKwppYHChanged lines 1-128 from:
%trail% <<|[[DocumentationIndex]]|>>
PmWiki uses [[WikiStyles]] for styling text with color and other attributes. PmWiki 2.0 introduced the ability to control the styling further and to even place styles on blocks.
A style is specified within a pair of %-signs and styles the text that follows, as in:
(:markup:) [=
This text is %color=red% red, %color=blue% 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 [@define=@] property. For example, to define a style of [@%red%@], one can use:
(:markup:) [=
%color=red define=mystyle%
Here is some %mystyle% red text created using a style shortcut.
=]
Shortcuts can be combined with other styles, including other shortcuts:
(:markup:) [=
%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.
=]
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 [@apply=@] style property. Specifying [@apply=block@] in a `WikiStyle will cause that style to be applied to the entire block, instead of just the text that follows:
(:markup:) [=
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 means it's now possible to do right-aligned and centered text:
(:markup:) [=
%block text-align=right% The text of this paragraph is right-aligned.
%block text-align=center% The text of this paragraph is centered.
=]
In fact, PmWiki predefines [@%right%@] and [@%center%@] style shortcuts so that you can do this more simply:
(:markup:) [=
%right% This is right-aligned.
%center% This is centered.
=]
Authors can define their own custom styles:
(:markup:) [=
%block bgcolor=#fdf define=Pm%
%center bgcolor=#dfd border='3px dotted green' define=goofy%
%right bgcolor=#ffffcc border='1px dotted red' padding=5px define=rediguana%
%define=strike text-decoration=line-through%
%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!
%goofy%Hello, I am %strike%upset%% %strike%disheartened%% happy to meet you.
=]
Styles can be applied to almost any kind of block:
(:markup:) [=
* %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%@], [@%roman%@], [@%ALPHA%@], and [@%alpha%@] list-block styles. The style has to be specified on the first item in the list (and we may develop an alternate syntax for this sort of ordered list):
(:markup:) [=
# %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 do this automatically -- see [[Cookbook:OutlineLists]].
!! Q & A
!!! How do I get a block of preformatted text?
Use something similar to this (assuming you want markup within the block to be interpreted as wiki markup and URIs to be recognized).
(:markup:)
>>white-space=pre<<
This block of text is ''preformatted'', see all the white-space
and linebreaks
are preserverd. Links such as [[wiki styles]] etc still work.
>><<
(:markupend:)
!!! How do I get a block of preformatted text with a colored background and a border?
Use something similar to this (note that wiki markup etc is not recognized within the block):
(:markup:)
%block bgcolor=#f0f9ff border='1px solid gray' padding=5px%[@
ip access-list extended example-acl
remark ** This is an example acl **
deny ip any host 10.0.0.1
permit ip any any
@]
(:markupend:)
%trail% <<|[[Documentation Index]]|>>
PmWiki uses [[WikiStyles]] for styling text with color and other attributes. PmWiki 2.0 introduced the ability to control the styling further and to even place styles on blocks.
A style is specified within a pair of %-signs and styles the text that follows, as in:
(:markup:) [=
This text is %color=red% red, %color=blue% 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 [@define=@] property. For example, to define a style of [@%red%@], one can use:
(:markup:) [=
%color=red define=mystyle%
Here is some %mystyle% red text created using a style shortcut.
=]
Shortcuts can be combined with other styles, including other shortcuts:
(:markup:) [=
%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.
=]
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 [@apply=@] style property. Specifying [@apply=block@] in a `WikiStyle will cause that style to be applied to the entire block, instead of just the text that follows:
(:markup:) [=
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 means it's now possible to do right-aligned and centered text:
(:markup:) [=
%block text-align=right% The text of this paragraph is right-aligned.
%block text-align=center% The text of this paragraph is centered.
=]
In fact, PmWiki predefines [@%right%@] and [@%center%@] style shortcuts so that you can do this more simply:
(:markup:) [=
%right% This is right-aligned.
%center% This is centered.
=]
Authors can define their own custom styles:
(:markup:) [=
%block bgcolor=#fdf define=Pm%
%center bgcolor=#dfd border='3px dotted green' define=goofy%
%right bgcolor=#ffffcc border='1px dotted red' padding=5px define=rediguana%
%define=strike text-decoration=line-through%
%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!
%goofy%Hello, I am %strike%upset%% %strike%disheartened%% happy to meet you.
=]
Styles can be applied to almost any kind of block:
(:markup:) [=
* %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%@], [@%roman%@], [@%ALPHA%@], and [@%alpha%@] list-block styles. The style has to be specified on the first item in the list (and we may develop an alternate syntax for this sort of ordered list):
(:markup:) [=
# %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 do this automatically -- see [[Cookbook:OutlineLists]].
!! Q & A
!!! How do I get a block of preformatted text?
Use something similar to this (assuming you want markup within the block to be interpreted as wiki markup and URIs to be recognized).
(:markup:)
>>white-space=pre<<
This block of text is ''preformatted'', see all the white-space
and linebreaks
are preserverd. Links such as [[wiki styles]] etc still work.
>><<
(:markupend:)
!!! How do I get a block of preformatted text with a colored background and a border?
Use something similar to this (note that wiki markup etc is not recognized within the block):
(:markup:)
%block bgcolor=#f0f9ff border='1px solid gray' padding=5px%[@
ip access-list extended example-acl
remark ** This is an example acl **
deny ip any host 10.0.0.1
permit ip any any
@]
(:markupend:)
%trail% <<|[[Documentation Index]]|>>
to:
Thanks for the example Ben. The intcrutsions were clear and easy to follow. I got it to work just fine This is now a very helpful feature for me. This example has sparked some other ideas I have and will try out some of my own hooks. Thanks again Ben, I'm sure many users will see how useful and powerful the hooks manager can be.