[pmwiki-users] include source code or command in pmwiki

pmwiki at 911networks.com pmwiki at 911networks.com
Wed Apr 25 15:38:52 CDT 2007


On Wed, 25 Apr 2007 12:09:45 -0700
"Clay Ye" <clay.ye at gmail.com> wrote:

> Hi,
> This may has been asked before but I did some search and haven't
> found it. My question is how to include some source code or just
> some command in pmwiki, I know in dokuwiki, you could use <code>
> </code>, and it will display in a block, like
> http://wiki.splitbrain.org/wiki:syntax#non-parsed_blocks, how to
> do this in pmwiki, I tried [@... @], but this one does not
> display in a block, format is not very good.

There are various ways:
You can use one of these:
%define=box block bgcolor=#FFFFCC border="2px dotted grey" padding=10px%		LIGHT YELLOW
%define=box block bgcolor=#BBFFFF border="2px dotted grey"%				LIGHT GREEN
%define=box block bgcolor=#f0f9ff border="2px dotted grey" padding=10px% 		LIGHT GREEN/GREY

and 

%box%[@...@]

or

(:markup:) [=
%define=box block bgcolor=#ddddff border="2px dotted blue"%

and

%box% [@
$ echo "Hello world"
Hello World
$ exit
@]

%box font-weight=bold color=green% [@
$ echo "I said, HELLO"
@]=]


Tip: Use custom style definitions to associate meanings with
text instead of just colors. For example, if warnings are to
be displayed as green text, set [@%define=warn green%@] and
then use [@%warn%@] instead of [@%green%@] in the document.
Then, if you later decide that warnings should be styled
differently, it's much easier to change the (one) definition
than many occurrences of [@%green%@] in the text.

or in your css you can:

.pre format
pre{border-style:solid; border-width:1px; padding-left:2px; width:80%; overflow:auto; } - in the css file.
pre { 
 margin: -0.8em 0 1.0em 0; 
 padding: 1em 0; 
 width: 95%; 
 font: 1em "Lucida Console", monospace,"Courier New"; 
 overflow: scroll; 
}



-- 
Thanks
http://www.911networks.com
When the network has to work



More information about the pmwiki-users mailing list