Sandkasten: Unterschied zwischen den Versionen

Aus Zebradem WIKI
Zur Navigation springenZur Suche springen
Die Seite wurde neu angelegt: „= WikiFormatting = TracGuideToc Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole. T…“
 
Zeile 55: Zeile 55:


Display:
Display:
[[TOC]]
= The Sandbox =
This is just a page to practice and learn WikiFormatting.
Go ahead, edit it freely.
Die Sandbox ist doch da!?
Was machen die Smilies? :-)
== Additional Goodies ==
=== Smileys ===
[[ShowSmileys(5)]]
=== Entities ===
[[ShowEntities(4)]]
=== Symbols ===
[[ShowSymbols(5)]]
== Tabellen mit MediaWiki Format verschönern ==
=== Ausführlich mit eigenen Formatierungen ===
==== Das gibt man ein: ====
{{{
{{{
#!mediawiki
{|border="1" cellpadding="2px" style="border-collapse:collapse;border:1px solid #8cacbb;border-width:1px;"
|-
! bgcolor="#dee7ec"|'''Überschrift'''
! bgcolor="#dee7ec"|'''Zweite Überschrift'''
|-
| Inhalt Zelle 1-1
| Inhalt Zelle 1-2
|-
| colspan="2" align="center"|Verbundene Zellen zentriert
|-
| Inhalt Zelle 3-1
| rowspan="2"|Verbundene Zelle
|-
| Inhalt Zelle 4-1
|}
}}}
}}}
==== Und so sieht das dann aus: ====
{{{
#!mediawiki
{|border="1" cellpadding="2px" style="border-collapse:collapse;border:1px solid #8cacbb;border-width:1px;"
|-
! bgcolor="#dee7ec"|'''Überschrift'''
! bgcolor="#dee7ec"|'''Zweite Überschrift'''
|-
| Inhalt Zelle 1-1
| Inhalt Zelle 1-2
|-
| colspan="2" align="center"|Verbundene Zellen zentriert
|-
| Inhalt Zelle 3-1
| rowspan="2"|Verbundene Zelle
|-
| Inhalt Zelle 4-1
|}
}}}
=== Mit "Standard-Formatierungen" ===
==== Das gibt man ein: ====
{{{
{{{
#!mediawiki
{|class="table"
|-
! Überschrift 1. Spalte
! Überschrift 2. Spalte
|-
| Inhalt 1.Zeile 1.Spalte
| Inhalt 1.Zeile 2.Spalte
|}
}}}
}}}
==== Und das sieht so aus: ====
{{{
#!mediawiki
{|class="table"
|-
! Überschrift 1. Spalte
! Überschrift 2. Spalte
|-
| Inhalt 1.Zeile 1.Spalte
| Inhalt 1.Zeile 2.Spalte
|}
}}}
Und das sind TracWiki Tabellen mit Header:
|||||| 1||| 2||| 3||
||| A||X||||X||
||| B||||X||||
||| C||X||X||||
nicht existierender Screenshot:
[[Screenshot(50)]]
== Playing with restructured text ==
{{{
{{{
#!rst
`WikiRestructuredText`:trac:
This is a reference to ticket `#12`:trac:
This is a reference to |a ticket|
.. |a ticket| trac:: #12
To learn how to use Trac, see `TracGuide`:trac:
This is a link to Freetz_.
.. _Freetz: http://trac.freetz.org/
|RST|_ is a little annoying to type over and over, especially
when writing about |RST| itself,
and spelling out the
bicapitalized word |RST| every time isn't really necessary for
|RST| source readability.
.. |RST| replace:: reStructuredText
.. _RST: http://docutils.sourceforge.net/rst.html
}}}
}}}
{{{
#!rst
`WikiRestructuredText`:trac:
This is a reference to ticket `#12`:trac:
This is a reference to |a ticket|
.. |a ticket| trac:: #12
To learn how to use Trac, see `TracGuide`:trac:
This is a link to Freetz_.
.. _Freetz: http://trac.freetz.org/
|RST|_ is a little annoying to type over and over, especially
when writing about |RST| itself,
and spelling out the
bicapitalized word |RST| every time isn't really necessary for
|RST| source readability.
.. |RST| replace:: reStructuredText
.. _RST: http://docutils.sourceforge.net/rst.html
}}}
{{{
#!mediawiki
== Text formatting markup ==
{| class="wikitable"
! Description !! You type !! You get
|-
! colspan="3" style="background:#ABE" | character (inline) formatting – ''applies anywhere''
|-
|Italic text
| <code><nowiki>''italic''</nowiki></code>
|''italic''
|-
| Bold text
| <code><nowiki>'''bold'''</nowiki></code>
|'''bold'''
|-
| Bold and italic
| <code><nowiki>'''''bold & italic'''''</nowiki></code>
|'''''bold & italic'''''
|-
|Escape wiki markup
| <code><nowiki><nowiki>no ''markup''&lt;/nowiki></nowiki></code>
|<nowiki>no ''markup''</nowiki>
|-
! colspan="3" style="background:#ABE" | section formatting – ''only at the beginning of the line''
|-
|Headings of different levels
| <pre>=level 1=
==level 2==
===level 3===
====level 4====
=====level 5=====
======level 6======</pre>
An article with 4 or more headings automatically creates a [[wikipedia:Wikipedia:Section#Table of contents (TOC)|table of contents]].
|<!-- hack to prevent TOC viewing for h1 - h6 elements: their style is hardcopied here -->
<div style="font-size: 188%; margin: 0; padding-top: .5em; padding-bottom: .17em; border-bottom: 1px solid #aaa">Level 1</div>
<div style="font-size: 150%; margin: 0; padding-top: .5em; padding-bottom: .17em; border-bottom: 1px solid #aaa">Level 2</div>
<div style="font-size: 132%; font-weight: bold">Level 3</div><!--
--><b>Level 4</b><!--
--><div style="font-size: 86%; font-weight: bold">Level 5</div><!--
--><b style="font-size: 80%">Level 6</b>
|-
|Horizontal rule
| <code>----</code>
|
----
|-
|Bullet list
|
<pre>
* one
* two
* three
** three point one
** three point two
</pre>
Inserting a blank line will end the first list and start another.
|
* one
* two
* three
** three point one
** three point two
|-
|Numbered list
|
<pre>
# one
# two<br />spanning more lines<br />doesn't break numbering
# three
## three point one
## three point two
</pre>
|
# one
# two<br />spanning more lines<br />doesn't break numbering
# three
## three point one
## three point two
|-
|Definition list
|<pre>
;item 1
: definition 1
;item 2
: definition 2-1
: definition 2-2
</pre>
|
;item 1
: definition 1
;item 2
: definition 2-1
: definition 2-2
|-
| Adopting definition list to indent text
|
<pre>: Single indent
:: Double indent
::::: Multiple indent</pre>
This workaround may be controversial from the viewpoint of accessibility.
|
: Single indent
:: Double indent
::::: Multiple indent
|-
| Mixture of different types of list
|
<pre>
# one
# two
#* two point one
#* two point two
# three
#; three item one
#: three def one
# four
#: four def one
#: this rather looks like the continuation of # four
#: and thus often used instead of <br />
# five
## five sub 1
### five sub 1 sub 1
## five sub 2
;item 1
:* definition 1-1
:* definition 1-2
:
;item 2
:# definition 2-1
:# definition 2-2
</pre>
The usage of <code>#:</code> and <code>*:</code> for breaking a line within an item may also be controversial.
|
# one
# two
#* two point one
#* two point two
# three
#; three item one
#: three def one
# four
#: four def one
#: this rather looks like the continuation of <code># four</code>
#: often used instead of <code>&lt;br /></code>
# five
## five sub 1
### five sub 1 sub 1
## five sub 2
;item 1
:* definition 1-1
:* definition 1-2
:
;item 2
:# definition 2-1
:# definition 2-2
|-
|-
|Preformatted text
|
<pre>
preformatted text is done with
a '''space''' at the
''beginning'' of the line
</pre>
This way of preformatting only applies to section formatting, and character formatting markups are still effective.
|
preformatted text is done with
a '''space''' at the
''beginning'' of the line
|}
}}}
Changesets: r4200:4250
== Testing new comment macro ==
==== Comment by oliver on Fr 16 Okt 2009 11:27:07 CEST ====
Test comment
==== Comment by olistudent on Do 28 Jan 2010 14:37:43 CET ====
test
==== Comment by olistudent on Do 28 Jan 2010 14:41:07 CET ====
test2
[[AddComment]]
= Heading =
= Heading =
== Subheading ==
== Subheading ==

Version vom 9. Dezember 2010, 07:30 Uhr

WikiFormatting

TracGuideToc

Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole.

Trac has a built in small and powerful wiki rendering engine. This wiki engine implements an ever growing subset of the commands from other popular Wikis, especially MoinMoin.


This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed.


Font Styles

The Trac wiki supports the following font styles: {{{

* bold, ! can be bold too, and ! 
* italic
* bold italic
* __underline__
* {{{monospace}}} or `monospace`
* ~~strike-through~~
* ^superscript^ 
* ,,subscript,,

}}}

Display:

* bold, ! can be bold too, and ! 
* italic
* bold italic
* __underline__
* {{{monospace}}} or `monospace`
* ~~strike-through~~
* ^superscript^ 
* ,,subscript,,

Notes:

* `{{{...}}}` and {{{`...`}}} commands not only select a monospace font, but also treat their content as verbatim text, meaning that no further wiki processing is done on this text.
* {{{ ! }}} tells wiki parser to not take the following characters as wiki format, so pay attention to put a space after !, e.g. when ending bold.

Headings

You can create heading by starting a line with one up to five equal characters ("=") followed by a single space and the headline text. The line should end with a space followed by the same number of = characters. The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.

Example: {{{

Heading

Subheading

About this

=== Explicit id === #using-explicit-id-in-heading }}}

Display:


TOC

The Sandbox

This is just a page to practice and learn WikiFormatting.

Go ahead, edit it freely.

Die Sandbox ist doch da!?

Was machen die Smilies? :-)

Additional Goodies

Smileys

ShowSmileys(5)

Entities

ShowEntities(4)

Symbols

ShowSymbols(5)

Tabellen mit MediaWiki Format verschönern

Ausführlich mit eigenen Formatierungen

Das gibt man ein:

{{{ border="1" cellpadding="2px" style="border-collapse:collapse;border:1px solid #8cacbb;border-width:1px;"

}}}

Und so sieht das dann aus:

border="1" cellpadding="2px" style="border-collapse:collapse;border:1px solid #8cacbb;border-width:1px;"

Mit "Standard-Formatierungen"

Das gibt man ein:

{{{ class="table"

}}}

Und das sieht so aus:

class="table"

Und das sind TracWiki Tabellen mit Header:

|||||| 1||| 2||| 3|| ||| A||X||||X|| ||| B||||X|||| ||| C||X||X||||

nicht existierender Screenshot:

Screenshot(50)

Playing with restructured text

{{{ a ticket }}} a ticket

class="wikitable"

! Description !! You type !! You get


Changesets: r4200:4250

Testing new comment macro

Comment by oliver on Fr 16 Okt 2009 11:27:07 CEST

Test comment

Comment by olistudent on Do 28 Jan 2010 14:37:43 CET

test

Comment by olistudent on Do 28 Jan 2010 14:41:07 CET

test2

AddComment

Heading

Subheading

About this

=== Explicit id === #using-explicit-id-in-heading

Paragraphs

A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.

A forced line break can also be inserted, using: {{{ Line 1BRLine 2 }}} Display:

Line 1BRLine 2


Lists

The wiki supports both ordered/numbered and unordered lists.

Example: {{{

* Item 1
  * Item 1.1
     * Item 1.1.1   
     * Item 1.1.2
     * Item 1.1.3
  * Item 1.2
* Item 2
1. Item 1
  a. Item 1.a
  a. Item 1.b
     i. Item 1.b.i
     i. Item 1.b.ii
1. Item 2

And numbered lists can also be given an explicit number:

3. Item 3

}}}

Display:

* Item 1
  * Item 1.1
     * Item 1.1.1
     * Item 1.1.2
     * Item 1.1.3
  * Item 1.2
* Item 2
1. Item 1
  a. Item 1.a
  a. Item 1.b
     i. Item 1.b.i
     i. Item 1.b.ii
1. Item 2

And numbered lists can also be given an explicit number:

3. Item 3

Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.


Definition Lists

The wiki also supports definition lists.

Example: {{{

llama::
  some kind of mammal, with hair
ppython::
  some kind of reptile, without hair
  (can you spot the typo?)

}}}

Display:

llama::
  some kind of mammal, with hair
ppython::
  some kind of reptile, without hair
  (can you spot the typo?)

Note that you need a space in front of the defined term.


Preformatted Text

Block containing preformatted text are suitable for source code snippets, notes and examples. Use three curly braces wrapped around the text to define a block quote. The curly braces need to be on a separate line.

Example: {{{

{{{
 def HelloWorld():
     print "Hello World"
}}}

}}}

Display: {{{

def HelloWorld():
    print "Hello World"

}}}


Blockquotes

In order to mark a paragraph as blockquote, indent that paragraph with two spaces.

Example: {{{

 This text is a quote from someone else.

}}}

Display:

 This text is a quote from someone else.

Discussion Citations

To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used.

Example: {{{ >> Someone's original text > Someone else's reply text My reply text }}}

Display: >> Someone's original text > Someone else's reply text My reply text

Note: Some WikiFormatting elements, such as lists and preformatted text, are lost in the citation area. Some reformatting may be necessary to create a clear citation.

Tables

Simple tables can be created like this:


Display: ||Cell 1||Cell 2||Cell 3|| ||Cell 4||Cell 5||Cell 6||

Note that more complex tables can be created using [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].


Links

Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.

Example: {{{

TitleIndex, http://www.edgewall.com/, !NotAlink

}}}

Display:

TitleIndex, http://www.edgewall.com/, !NotAlink

Links can be given a more descriptive title by writing the link followed by a space and a title and all this inside square brackets. If the descriptive title is omitted, then the explicit prefix is discarded, unless the link is an external link. This can be useful for wiki pages not adhering to the WikiPageNames convention.

Example: {{{

* Edgewall Software
* [wiki:TitleIndex Title Index]
* [wiki:ISO9000]

}}}

Display:

* Edgewall Software
* [wiki:TitleIndex Title Index]
* [wiki:ISO9000]

Trac Links

Wiki pages can link directly to other parts of the Trac system. Pages can refer to tickets, reports, changesets, milestones, source files and other Wiki pages using the following notations: {{{

* Tickets: #1 or ticket:1
* Reports: {1} or report:1
* Changesets: r1, [1] or changeset:1
* ...

}}}

Display:

* Tickets: #1 or ticket:1
* Reports: {1} or report:1
* Changesets: r1, [1] or changeset:1
* ... 

There are many more flavors of Trac links, see TracLinks for more in-depth information.


Escaping Links and WikiPageNames

You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).

Example: {{{

!NoHyperLink
!#42 is not a link

}}}

Display:

!NoHyperLink
!#42 is not a link


Images

Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.

You now have to use the !Image macro. The simplest way to include an image is to upload it as attachment to the current page, and put the filename in a macro call like `Image(picture.gif)`.

In addition to the current page, it is possible to refer to other resources:

* `Image(wiki:WikiFormatting:picture.gif)` (referring to attachment on another page)
* `Image(ticket:1:picture.gif)` (file attached to a ticket)
* `Image(htdocs:picture.gif)` (referring to a file inside project htdocs)
* `Image(source:/trunk/trac/htdocs/trac_logo_mini.png)` (a file in repository)

Example display: Image(htdocs:../common/trac_logo_mini.png)

See WikiMacros for further documentation on the `Image()` macro.


Macros

Macros are custom functions to insert dynamic content in a page.

Example: {{{

RecentChanges(Trac,3)

}}}

Display:

RecentChanges(Trac,3)

See WikiMacros for more information, and a list of installed macros.


Processors

Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].

Example 1: {{{

  1. !html
{{{
#!html
<h1 style="text-align: right; color: blue">HTML Test</h1>
}}}

}}}

Display: {{{

  1. !html

HTML Test

}}}

Example: {{{

  1. !html
{{{
#!python
class Test:

    def __init__(self):
        print "Hello World"
if __name__ == '__main__':
   Test()
}}}

}}}

Display: {{{

  1. !python

class Test:

   def __init__(self):
       print "Hello World"

if __name__ == '__main__':

  Test()

}}}

Perl: {{{

  1. !perl

my ($test) = 0; if ($test > 0) {

   print "hello";

} }}}

See WikiProcessors for more information.


Comments

Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text. {{{ {{{

  1. !comment

Your comment here }}} }}}


Miscellaneous

Four or more dashes will be replaced by a horizontal line (


)

Example: {{{

----

}}}

Display:




See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.