# Changes between Version 3 and Version 4 of WikiFormatting

Ignore:
Timestamp:
11/24/16 03:15:40 (3 years ago)
Comment:

--

Unmodified
Added
Removed
Modified
• ## WikiFormatting

 v3 = WikiFormatting = = 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 [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. Trac has a built-in small and powerful wiki rendering engine. This wiki engine implements a growing subset of the commands from other popular Wikis, especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. This page will give you an in-depth explanation of the wiki markup available anywhere WikiFormatting is allowed. The ''Cheat sheet'' below gives you a quick overview for the most common syntax, each link in the ''Category'' column will lead you to the more detailed explanation later in this page. The sections below provide an overview for the most common syntax, each link in the ''Category'' column will lead you to the more detailed explanation later in this page. A few other wiki pages present the advanced features of the Trac wiki markup in more depth: - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof, - WikiPageNames talks about the various names a wiki page can take, CamelCase or not - WikiMacros lists the macros available for generating dynamic content, - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways == Cheat sheet == - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof. - WikiPageNames covers the various names a wiki page can take, whether in CamelCase or not. - WikiMacros lists the macros available for generating dynamic content. - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways. - [trac:wiki:TracDev/Proposals/AdvancedWikiOperations AdvancedWikiOperations] provides some operations in uncommon or administrative scenarios. == Common wiki markup ||= '''Category''' =||= '''Wiki Markup''' =||= '''Display''' =|| {{{#!td {{{ == Level 2 == == Level 2 === Level 3 ^([#hn note])^ }}} }}} {{{#!td style="padding-left: 2em" == Level 2 == == Level 2 === Level 3 ^([#hn note])^ }}} {{{#!td {{{ * bullets list * bullet list on multiple lines 1. nested list }}} {{{#!td * bullets list * bullet list on multiple lines 1. nested list || `!wiki:WikiFormatting`, `!WikiFormatting` ||\ || !wiki:WikiFormatting, !WikiFormatting || || {{{`}}}`{{{-}}}`{{{`}}}` triple curly brackets` ||\ || [[html(`{{{-}}}` triple curly brackets)]] ||\ || `{{{-}}}` triple curly brackets || |----------------------------------------------------------- }}} == Font Styles == == Font Styles The Trac wiki supports the following font styles: * **also bold**, //italic as well//, and **'' bold italic **'' //(since 0.12)// * [[span(style=color: #FF0000, a red text )]] }}} }}} * **also bold**, //italic as well//, and **'' bold italic **'' //(since 0.12)// * [[span(style=color: #FF0000, a red 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. * all the font styles marks have to be used in opening/closing pairs, and they must nest properly (in particular, an `''` italic can't be paired with a `//` one, and `'''` can't be paired with `**`) == Headings == You can create heading by starting a line with one up to six ''equal'' characters ("=") followed by a single space and the headline text. and they must nest properly; in particular, an `''` italic can't be paired with a `//` one, and `'''` can't be paired with `**`. == Headings You can create heading by starting a line with one up to six ''equal'' characters ("=") followed by a single space and the headline text. [=#hn] The headline text can be followed by the same number of "=" characters, but this is no longer mandatory. The headline text can be followed by the same number of "=" characters, but this is not mandatory. That is, `=== Section3 ===` is identical to `=== Section3`. Finally, the heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. }}} == Paragraphs == == Paragraphs A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. }}} == Lists == == Lists The wiki supports both ordered/numbered and unordered lists. }}} == Definition Lists == == Definition Lists The wiki also supports definition lists. Note that you need a space in front of the defined term. == Preformatted Text == == 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. Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors. == Blockquotes == == Blockquotes In order to mark a paragraph as blockquote, indent that paragraph with two spaces. }}} == 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. == Discussion Citations To delineate a citation in an ongoing discussion thread, such as the ticket comment area, email-like citation marks (">", ">>", etc.) may be used. ||= Wiki Markup =||= Display =|| }}} == Tables == === Simple Tables === == Tables === Simple Tables Simple tables can be created like this: ||= Wiki Markup =||= Display =|| }}} === Complex Tables === If the possibilities offered by the simple "pipe"-based markup for tables described above are not enough for your needs, you can create more elaborated tables by using [#Processors-example-tables WikiProcessor based tables]. == Links == Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. === Complex Tables If the possibilities offered by the simple pipe-based markup ('||') for tables described above are not enough for your needs, you can create more elaborate tables by using [#Processors-example-tables WikiProcessor based tables]. == Links Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark ('!'), such as {{{!WikiPageLink}}}. ||= Wiki Markup =||= Display =|| }}} '''Note''': the [trac:WikiCreole] style for links is quick to type and certainly looks familiar as it's the one used on Wikipedia and in many other wikis. Unfortunately it conflicts with the syntax for [#Macros macros]. So in the rare case when you need to refer to a page which is named after a macro (typical examples being TitleIndex, InterTrac and InterWiki), by writing `[[TitleIndex]]` you will actually call the macro instead of linking to the page. == Trac Links == '''Note''': the [trac:WikiCreole] style for links is quick to type and certainly looks familiar as it is the one used on Wikipedia and in many other wikis. Unfortunately it conflicts with the syntax for [#Macros macros]. So in the rare case when you need to refer to a page which is named after a macro (typical examples being TitleIndex, InterTrac and InterWiki), by writing `[[TitleIndex]]` you will actually call the macro instead of linking to the page. == 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: There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers. == Setting Anchors == == Setting Anchors An anchor, or more correctly speaking, an [http://www.w3.org/TR/REC-html40/struct/links.html#h-12.2.1 anchor name] can be added explicitly at any place in the Wiki page, in order to uniquely identify a position in the document: }}} It's also very close to the syntax for the corresponding link to that anchor: It is also very close to the syntax for the corresponding link to that anchor: {{{ [#point1] }}} For more complex anchors (e.g. when a custom title is wanted), one can use the Span macro, e.g. `[[span(id=point2, class=wikianchor, title=Point 2, ^(2)^)]]`. For more complex anchors (eg when a custom title is wanted), you can use the Span macro: `[[span(id=point2, class=wikianchor, title=Point 2, ^(2)^)]]`. == Escaping Links, WikiPageNames and other Markup == #Escaping You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). You may avoid making hyperlinks out of TracLinks by preceding an expression with a single exclamation mark ('!'). ||= Wiki Markup =||= Display =|| {{{ Various forms of escaping for list markup: `-` escaped minus sign \\ ``1. escaped number  \\ {{{*}}} escaped asterisk sign ^^- escaped minus sign \\ ^^1. escaped number  \\ ^^* escaped asterisk sign }}} }}} Various forms of escaping for list markup: `-` escaped minus sign \\ ``1. escaped number  \\ {{{*}}} escaped asterisk sign }}} == Images == ^^- escaped minus sign \\ ^^1. escaped number  \\ ^^* escaped asterisk sign }}} == Images Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `` tags. See WikiMacros for further documentation on the `[[Image()]]` macro, which has several useful options (`title=`, `link=`, etc.) == Macros == == Macros Macros are ''custom functions'' to insert dynamic content in a page. }}} == Processors == == Processors Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in See WikiProcessors for more information. == Comments == == 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. Your comment for editors here }}} see ;-) see. }}} }}} Your comment for editors here }}} see ;-) }}} == Miscellaneous == An horizontal line can be used to separated different parts of your page: ||= Wiki Markup =||= Display =|| {{{#!td see. }}} == Miscellaneous ||= Wiki Markup =||= Display =|| {{{#!td Horizontal line: {{{ Four or more dashes will be replaced by an horizontal line (
) by a horizontal line (
) ---- See? {{{#!td Four or more dashes will be replaced by an horizontal line (
) by a horizontal line (
) ---- See? |---------------------------------- {{{#!td {{{ "macro" style [[br]] line break }}} }}} {{{#!td "macro" style [[br]] line break Two examples of line breaks: {{{ "macro" style [[BR]] line break }}} or: {{{ !WikiCreole style \\ line\\break }}} }}} {{{#!td "macro" style [[BR]] line break !WikiCreole style \\ line\\break }}} |---------------------------------- {{{#!td {{{ !WikiCreole style \\ line\\break }}} }}} {{{#!td !WikiCreole style \\ line\\break }}}