» Project Kenai Documentation and Training » How Do I ...
This page provides some examples of Mediawiki markup that aren't found on About Wikis. That page does provide a comprehensive list of wiki markup tags, but doesn't attempt to provide all the possible combinations and examples.
Note: To see the wiki markup for these examples, choose Show Page as Text from the Wiki Controls menu on the left.
Text can be made bold or italics or both by using simple wiki markup.
You can also use XHTML elements for things like in-line code or subscripts or superscripts.
A note about XHTML markup characters: You can use characters like '<' and '>' freely in your text, without worrying about having to escape them. Only if what you type looks like an XHTML start tag or end tag will it be interpreted as such. There are two ways to escape start and end tags:
Use <tag> — <tag>
Surround the tag with <nowiki><tag></nowiki> tags — <tag>
An internal link to [[Home]] — Home
An internal link with different text [[Home|The Home Page]] — The Home Page .
An external link to [http://oracle.com] — http://oracle.com.
An external link with different link text [http://oracle.com Oracle's Home Page] — Oracle's Home Page
A link to <a href="{{project}}">this project's home page</a> — this project's home page
A link to <a href="{{forums}}">this project's forums</a> — this project's forums
A link to <a href="{{projects}}">the list of all projects</a> — the list of all projects
A link to <a href="{{project help}}">Project Help</a> — Project Help
A link to <a href="{{project help page WebHooks}}">the Project Help page about Web Hooks</a> — the Project Help page about Web Hooks
An unordered list:
An ordered list:
A mix of ordered and unordered lists:
A definition list:
A simple table:
| heading 1 | heading 2 |
|---|---|
| first cell | second cell |
Lists inside table cells:
| heading 1 | heading 2 |
|---|---|
|
|
A table within a table cell that uses simple bolding and regular cell markers for the heading:
| heading 1 | heading 2 | ||||
| Data |
|
A table that uses HTML format, style tags, and attributes like valign="top".
| Message Forums | ||||||
| Activity | Administrator | Software Developer | Content Developer | Observer | Unauthenticated | Unregistered |
| Read | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Create Post | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Edit Post | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Delete Post | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Edit or Delete Any Post | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Mailing Lists | ||||||
| Activity | Administrator | Software Developer | Content Developer | Observer | Unauthenticated | Unregistered |
| View List | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Administer List | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
| View Archive | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Close List | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Moderate Posts | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Compose on Web | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Subscribe to List | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
The golden ratio may be expressed as:
x x + 1
- == -----
1 x
[[image: gregory.jpg]]
[[image: gregory.jpg|thumb]]
[[image: gregory.jpg|80x20px|A picture of Gregory]]
[[image:gregory.jpg|thumb|right]]</tt>

Uses block parameter to add horizontal scrollbar to page:
[[image:testimage-toowide.png|block]]

Mediawiki enables simple formatting of code if you add a space before each line of code. However, something you can't do easily is show HTML markup as code. For that, it's easiest to use the <pre> tag. Also, you can get some nice formatting of multiple lines of source code by using the language name with the <pre> tag. For example,
Use the <pre> tag to show more than one line of HTML code in a monospaced font.
<!-- New HTML code based on FlickrSlideShow sample. -->
<div id="FlickrSlideShowWidget">
Enter a Flickr tag to search for photos: <br/>
<input id="flickrTag" type="text" value="Yosemite" />
<br/>
Enter a page number to see more photos.<br />
<input id="pagenum" type="text" value="1" /> <br/>
<button id="searchButton">Search</button><br/><hr/><br/>
<div id="FlickrSearchResults"></div>
</div>
Use <pre name="ruby"> with your ruby code to get the formatting below.
# POST /albums
# POST /albums.xml
def create
@album = Album.new(params[:album])
respond_to do |format|
if @album.save
flash[:notice] = 'Album was successfully created.'
format.html { redirect_to(@album) }
format.xml { render :xml => @album, :status => :created, :location => @album }
else
format.html { render :action => "new" }
format.xml { render :xml => @album.errors, :status => :unprocessable_entity }
end
end
end
Use <pre name="php"> with your php code to get the formatting below.
<?php
// db connection info
$db_name= 'hook_data';
$dbh = mysqli_connect('127.0.0.1', 'root', '');
$db_exists = $dbh->select_db($db_name);
// db/table setup
if (!$db_exists) {
$res = $dbh->query("CREATE DATABASE $db_name");
if (!$res)
die("could not create database");
$dbh->select_db($db_name);
}
...
Use <pre name="java"> with your Java code to get the formatting below.
public static String acrostic(String[] args) {
StringBuffer b = new StringBuffer();
for (int i = 0; i < args.length; i++) {
if (args[i].length() > i) {
b.append(args[i].charAt(i));
} else {
b.append('?');
}
}
return b.toString();
Use <pre name="css"> with your css code to get the formatting below.
.banner {
margin: 0px 40px 0px 0px;
display:table-cell;
vertical-align:middle;
font-size:35px;
}