Editing help

From Tycoon Online
Revision as of 22:46, 27 May 2008 by Nrg1664 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

tags:wiki syntax


toc:

== Introduction

This document describes the syntax used by svnwiki to represent contents in a wiki.

If you have suggestions to improve svnwiki, please let us know.

== Basic text formatting

=== Creating a paragraph

To create a paragraph simply enter the text. You can place a single newline anywhere in your paragraph and it will have no effect.

To split a paragraph use two consecutive newlines (an empty line).

The above two paragraphs could have been written as:

To create a paragraph simply enter the text.
You can place a single newline anywhere in
your paragraph and it will have no effect.
To split a paragraph use two consecutive newlines (an empty line).

=== Font styles (bold, italics, technical)

To create bold text, use three apostrophes ('), as in:

'''bold'''

Use two for italics:

''italics''

For Template:Type-written text, which is useful for technical documentation, use this syntax:

{{text}}

Related with type-written text, you can mark entire paragraphs to be shown in type-written text. This is used for lines that correspond to program's output or commands that a user should enter. To active this all you need to do is start each line in your paragraph with a space. Paragraphs written in this manner are shown as follows:

> uptime
 23:04:03 up 14:18,  1 user,  load average: 0.02, 0.06, 0.18
> uname -a
Linux azul 2.6.10 #1 Mon Feb 7 00:20:16 COT 2005 i686 GNU/Linux
>

=== Font size (big, small)

To increase or decrease the size of the text you can wrap it around a pair of <big>...</big> and <small>...</small> tags respectively.

Example:

<big>This text is big...</big>
<small>... and this is small.</small>

This is shown as:

This text is big...

... and this is small.


=== Centering text

To center text you can wrap multiple paragraphs (and lists, titles, etc.) with a pair of <center>...</center> tags, as in:

<center>
 some text
 * item
 * another
 </center>

This will be shown as:

>

> some text > * item > * another

>

=== Special characters

svnwiki automatically replaces certain sequences of characters with HTML entities that browsers display better. The following is the list of sequences:

(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >>

These sequences are replaced with these characters respectively: (R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >>


=== Quotes

If you want to make quotes, you can start your lines with > (the standard character for email quotation). Alternatively, you can surround it with <blockquote> ... </blockquote>

This text will be show as:

> I am enough of an artist to draw freely upon my imagination. > Imagination is more important than knowledge. > Knowledge is limited. > Imagination encircles the world.

== Organizing your article (Table of contents, lists, tables, horizontal lines)

=== Creating titles

To create a title, use a line starting with two, three, four or five equal signs:

== Title Name
=== Sub-title Name
==== Sub-sub-title Name
===== Sub-sub-sub-title Name

If you use two equal signs, you will create a top-level title. The more equal signs you use, the less important your title will be.

An alternative option for creating titles is using <h1> <h2>, <h3>, <h4>, <h5> and <h6> tags. There is one important difference with the previous syntax: tags created in this manner will not be included in the articles' Table of Contents. For this reason, you are encouraged not to use this syntax unless you have specific reasons.

=== Table of Contents

If you want to show the table of contents of an article, use the following code:

[[toc:]]

This will be replaced with the table of contents. You can see an example at the beginning of this page.

=== Using tables

You can create a table using the standard HTML syntax, based on the <table>, <tr> and <td> tags.

Example:

CountryNumber of cities
Colombia16
Argentina16
Brasil31

This is shown as:

CountryNumber of cities
Colombia17
Argentina12
Brasil31

Currently it is not possible to include parameters in any of the above tags; this will probably be fixed in a future release.

=== Horizontal dividing line

You can include an horizontal dividing line with the followking markup:

----

This is shown as:


== Lists

=== Lists of items

You can create lists of bullets or numbers by starting your lines with asterisks or number signs:

* Some item
* Another item
** A sub item
** Another sub item
**# A numbered sub sub item
**# Another numberd sub sub item
* The last item

The above list will be rendered as:

  • Some item
  • Another item
    • A sub item
    • Another sub item
      1. A numbered sub sub item
      2. Another numberd sub sub item
  • The last item

As you can see, you can mix lists of bullets and numbers in any way you want.

=== Lists of Definitions

You can create a list of definitions by using multiple lines with the following syntax:

; TERM : DEFINITION

This is useful to give a list of terms along with their respective definitions.

Example:

; Lassie : A very intelligent dog.
; Garfield : A pessimistic cat.
; Tux : A fearsome pinguin.

This list is shown as:

Lassie 
A very intelligent dog.
Garfield 
A pessimistic cat.
Tux 
A fearsome pinguin.

== Links and images

=== Creating Links

To create links use [[dst]], where dst is the link target. You can use relative or absolute URLs.

If you want your link to display a text other than its target, use [[dst|Some text]]. This will be shown as: Some text.

Here are some examples:

  • [[http://wiki.freaks-unidos.net/]]
  • [[default|Home Page]]

=== Including Images

To include images in your articles use the following text:

[[image:URL|ALT]]

Here you'll need to replace URL with the URL of your image (which can be absolute or relative) and ALT with a simple description of the image.

Example:

[[image:http://azul.freaks-unidos.net/files/svnwiki-small.png|Image]]

Renders this:

Image

== Programming languages

=== Syntax coloring

You can embbed code or information in many file formats or programming languages; Svnwiki will use [Enscript] to highlight it. Use the <enscript> tag and pass the programming language or file format as the highlight parameter.

For example,

<enscript highlight=c>
static void
pinst_check ()
{
  pid_t pinst = pinst_find();
  if (pinst != -1 && kill(pinst, 0) != -1)
    printf("%s: server alive (%d)\n", program_name, pinst);
  else
    printf("%s: server is not running\n", program_name);
  exit(EXIT_SUCCESS);
}
</enscript>

is shown as:

<enscript highlight=c> static void pinst_check () {

 pid_t pinst = pinst_find();
 if (pinst != -1 && kill(pinst, 0) != -1)
   printf("%s: server alive (%d)\n", program_name, pinst);
 else
   printf("%s: server is not running\n", program_name);
 exit(EXIT_SUCCESS);

} </enscript>

Note that in order for this to work you'll need to have GNU Enscript installed and the Enscript svnwiki extension. If you don't, the information will be shown with no coloring.

The following languages are supported: ada asm awk bash c changelog cpp csh delphi diff diffs diffu dylan eiffel elisp erlang forth fortran fortran_pp haskell html icon idl inf java javascript ksh lua m4 mail makefile matlab nroff oberon2 objc outline oz pascal perl postscript pyrex python rfc scheme sh skill smalltalk sml sql states synopsys tcl tcsh tex vba verilog vhdl vrml wmlscript zsh.

=== Embedding Scheme code

It is possible to embbed entire programs in the Scheme programming language inside the wiki pages. svnwiki will execute it securely (in a safe environment) and replace it with whatever output it produces.

For example, you could include code that prints some numbers:

<scheme>

<enscript highlight=scheme> (let loop ((a 0) (b 1) (i 0))

 (cond
((< i 10) (format #t "

~A: ~A~%" i a) (loop b (+ a b) (+ i 1))))) </enscript> </scheme> This code would get replaced with the following: <scheme> (let loop ((a 0) (b 1) (i 0)) (cond ((< i 10) (format #t "<p>~A: ~A~%" i a) (loop b (+ a b) (+ i 1))))) </scheme> Note that the output of the Scheme code will be included literally in the page (so you can output HTML tags directly). === Literal code To include something in a page literally (preventing svnwiki to convert it from wiki to HTML), place it inside a <nowiki> ... </nowiki> pair.