Last updated November 07, 2012 19:13, by nvause
Feedicon  

» Project Kenai Documentation and Training    » How Do I ...

MediaWiki Sampler

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.


Inline Formatting

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 &lt;tag&gt; — <tag>
    Surround the tag with <nowiki><tag></nowiki> tags  —  <tag>

Links

Links to other wiki pages

An internal link to [[Home]] — Home

An internal link with different text [[Home|The Home Page]] — The Home Page .

Links to external web pages

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

Parameterized links to other projects and project features

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

Lists

An unordered list:

  • AAA
    • 111
    • 222
  • BBB

An ordered list:

  1. AAA
    1. 111
    2. 222
  2. BBB

A mix of ordered and unordered lists:

  1. AAA
    • 111
    • 222
  2. BBB

A definition list:

wiki
a page that is quick to edit

Tables

A simple table:

heading 1 heading 2
first cell second cell

Lists inside table cells:

heading 1 heading 2
  • a
  • b
  • 1
  • 2

A table within a table cell that uses simple bolding and regular cell markers for the heading:

heading 1heading 2
Data
x y
p q

A table that uses HTML format, style tags, and attributes like valign="top".

Message Forums
ActivityAdministratorSoftware DeveloperContent DeveloperObserverUnauthenticatedUnregistered
Read
Create Post
Edit Post
Delete Post
Edit or Delete Any Post
Mailing Lists
ActivityAdministratorSoftware DeveloperContent DeveloperObserverUnauthenticatedUnregistered
View List
Administer List
View Archive
Close List
Moderate Posts
Compose on Web
Subscribe to List

Blocks


The golden ratio may be expressed as:

    x      x + 1
    -  ==  -----
    1        x


Images

A big image

[[image: gregory.jpg]]



Thumbnail image

[[image: gregory.jpg|thumb]]



Image with strange size and a title

[[image: gregory.jpg|80x20px|A picture of Gregory]]

A picture of Gregory

Thumbnail floated to the right

[[image:gregory.jpg|thumb|right]]</tt>



xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx xxxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxxxxxxxxx. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx xxxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxxxxxxxxx.xxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx xxxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxxxxxxxxx.xxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxx xxxxxxxx xxxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxx xxxxxxxxxx

Image too wide for page

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

Source Code Formatting

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,

Formatting HTML Source Code

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>

Formatting Ruby Source Code

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

Formatting PhP Source Code

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);  
  }  
  ...  

Formatting Java Source Code

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();

Formatting CSS Source Code

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;
  }

Project Features

Wiki Controls

About this Project

Help for netbeans.org Site Tools was started in November 2009, is owned by kenaiadmin, and has 17 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close