Project

General

Profile

Feature #23413 » wiki_syntax_detailed_textile.html

Hiroo Hayashi, 2016-07-23 17:44

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>RedmineWikiFormatting</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
pre, code { font-size:120%; }
pre code { font-size:100%; }
pre {
margin: 1em 1em 1em 1.6em;
padding: 2px;
background-color: #fafafa;
border: 1px solid #e2e2e2;
width: auto;
overflow-x: auto;
overflow-y: hidden;
}
a.new { color: #b73535; }

.syntaxhl .class { color:#258; font-weight:bold }
.syntaxhl .comment { color:#385; }
.syntaxhl .delimiter { color:black }
.syntaxhl .function { color:#06B; font-weight:bold }
.syntaxhl .inline { background-color: hsla(0,0%,0%,0.07); color: black }
.syntaxhl .inline-delimiter { font-weight: bold; color: #666 }
.syntaxhl .instance-variable { color:#33B }
.syntaxhl .keyword { color:#939; font-weight:bold }
.syntaxhl .string .content { color: #46a }
.syntaxhl .string .delimiter { color:#46a }
</style>
</head>

<!--
Don't edit this file directly.
Update the wiki page <http://www.redmine.org/projects/redmine/wiki/RedmineTextFormattingTextile> first. Then merge the change to this file.
See <http://www.redmine.org/issues/23413> for more details.
-->
<body>
<h1 >Textile formatting</h1>


<p>Below is <strong>Textile</strong> formatting. For <strong>Markdown</strong> formatting see <a href="/projects/redmine/wiki/RedmineTextFormattingMarkdown" class="wiki-page">RedmineTextFormattingMarkdown</a>.<br />For limitations of current Textile support see <a href="/issues/6269" class="issue tracker-2 status-1 priority-4 priority-default" title="RedCloth 4 support (New)">#6269</a>, <a href="/issues/10078" class="issue tracker-2 status-1 priority-4 priority-default" title="Definition List support (New)">#10078</a> (Definition Lists).</p>



<h2 >Links</h2>


<h3 >Redmine links</h3>


<p><p>Redmine allows hyperlinking between resources (wiki pages, issues, documents...) from anywhere text formatting is used.</p>


<p>Wiki links:</p>


<ul>
<li><strong>&#91;&#91;Guide&#93;&#93;</strong> displays a link to the page named 'Guide': <a href="/projects/redmine/wiki/Guide" class="wiki-page">Guide</a></li>
<li><strong>&#91;&#91;Guide#further-reading&#93;&#93;</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <a href="/projects/redmine/wiki/Guide#further-reading" class="wiki-page">Guide</a></li>
<li><strong>&#91;&#91;Guide|User manual&#93;&#93;</strong> displays a link to the same page but with different text: <a href="/projects/redmine/wiki/Guide" class="wiki-page">User manual</a></li>
<li><strong>&#91;&#91;Guide#User-guide|User guide&#93;&#93;</strong> displays a link to the header on the same page with different text: <a href="/projects/redmine/wiki/Guide#User-guide" class="wiki-page">User guide</a></li>
</ul>


<p>You can also link to pages of another project's wiki (using the project identifier):</p>


<ul>
<li><strong>&#91;&#91;sandbox:some page&#93;&#93;</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
<li><strong>&#91;&#91;sandbox:&#93;&#93;</strong> displays a link to the Sandbox wiki main page</li>
</ul>


<p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="/projects/redmine/wiki/Nonexistent_page?parent=RedmineTextFormattingRedmineLinks" class="wiki-page new">Nonexistent page</a>.</p>


<p>Links to other resources:</p>


<ul>
<li>Issues:

<ul>
<li><strong>#124</strong> (link to an issue: displays <a href="/issues/124" class="issue tracker-1 status-5 priority-4 priority-default closed" title="bulk edit doesn&#x27;t change the category or fixed version properties (Closed)">#124</a>, link is striked-through if the issue is closed)</li>
<li><strong>#124-6</strong>, or <strong>#124#note-6</strong> (link to an issue note: displays <a href="/issues/124#note-6" class="issue tracker-1 status-5 priority-4 priority-default closed" title="bulk edit doesn&#x27;t change the category or fixed version properties (Closed)">#124-6</a>, or <a href="/issues/124#note-6" class="issue tracker-1 status-5 priority-4 priority-default closed" title="bulk edit doesn&#x27;t change the category or fixed version properties (Closed)">#124#note-6</a>)</li>
</ul></li>
</ul>


<ul>
<li>Documents:

<ul>
<li><strong>document#17</strong> (link to document with id 17)</li>
<li><strong>document:Greetings</strong> (link to the document with title "Greetings")</li>
<li><strong>document:"Some document"</strong> (double quotes can be used when document title contains spaces)</li>
<li><strong>sandbox:document:"Some document"</strong> (link to a document with title "Some document" in project identifier "sandbox")</li>
</ul></li>
</ul>


<ul>
<li>Versions:

<ul>
<li><strong>version#3</strong> (link to version with id 3)</li>
<li><strong>version:1.0.0</strong> (link to version named "1.0.0")</li>
<li><strong>version:"1.0 beta 2"</strong> (double quotes can be used when version name contains spaces)</li>
<li><strong>sandbox:version:1.0.0</strong> (link to version "1.0.0" in the project identifier "sandbox")</li>
</ul></li>
</ul>


<ul>
<li>Attachments:

<ul>
<li><strong>attachment:file.zip</strong> (link to the attachment of the current object named file.zip)</li>
<li><strong>attachment:"file name.zip"</strong> (double quotes can be used when the filename contains non word characters)</li>
<li>For now, attachments of the current object can be referenced only (if you're on an issue, it's possible to reference attachments of this issue only)</li>
</ul></li>
</ul>


<ul>
<li>Changesets:

<ul>
<li><strong>r758</strong> (link to a changeset, displays <a href="/projects/redmine/repository/revisions/758" class="changeset" title="Search engine now only searches objects the user is allowed to view.">r758</a>)</li>
<li><strong>commit:c6f4d0fd</strong> (link to a changeset with a non-numeric hash)</li>
<li><strong>svn1|r758</strong> (link to a changeset of a specific repository, for projects with multiple repositories)</li>
<li><strong>commit:hg|c6f4d0fd</strong> (link to a changeset with a non-numeric hash of a specific repository)</li>
<li><strong>sandbox:r758</strong> (link to a changeset of another project)</li>
<li><strong>sandbox:commit:c6f4d0fd</strong> (link to a changeset with a non-numeric hash of another project identifier)</li>
</ul></li>
</ul>


<ul>
<li>Repository files:

<ul>
<li><strong>source:some/file</strong> (link to the file located at /some/file in the project's repository)</li>
<li><strong>source:"some file"</strong> (link to the file with non word characters in the path)</li>
<li><strong>source:some/file@52</strong> (link to the file's revision 52)</li>
<li><strong>source:some/file#L120</strong> (link to line 120 of the file)</li>
<li><strong>source:some/file@52#L120</strong> (link to line 120 of the file's revision 52)</li>
<li><strong>source:repo_identifier|some/file</strong> (link to a file of a specific repository, for projects with multiple repositories)</li>
<li><strong>sandbox:source:some/file</strong> (link to the file in the project identifier "sandbox")</li>
<li><strong>export:some/file</strong> (force the download of the file)</li>
</ul></li>
</ul>


<ul>
<li>Forums:

<ul>
<li><strong>forum#2</strong> (link to forum with id 2)</li>
<li><strong>forum:Discussion</strong> (link to forum with name "Discussion")</li>
<li><strong>forum:"Help and more"</strong> (double quotes can be used when forum name contains spaces)</li>
</ul></li>
</ul>


<ul>
<li>Forum messages:

<ul>
<li><strong>message#1218</strong> (link to message with id 1218)</li>
</ul></li>
</ul>


<ul>
<li>News items

<ul>
<li><strong>news#1</strong> (link to news item with id 1)</li>
<li><strong>news:Greetings</strong> (link to news item with name "Greetings")</li>
<li><strong>news:"eCookbook first release !"</strong> (double quotes can be used when news item name contains spaces)</li>
</ul></li>
</ul>


<ul>
<li>Projects:

<ul>
<li><strong>project#3</strong> (link to project with id 3)</li>
<li><strong>project:someproject</strong> (link to project with name "someproject")</li>
<li><strong>project:"Multiple words project"</strong> (double quotes can be used when project name contains spaces)</li>
</ul></li>
</ul>


<p>Escaping:</p>


<ul>
<li>You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !</li>
</ul></p>


<h3 >External links</h3>


HTTP URLs are automatically turned into clickable links:
<ul>
<li><strong>http&#58;//www.redmine.org</strong> -- External link to the redmine website: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a></li>
</ul>


HTTP URLs can also use different text than the link itself:
<ul>
<li><strong>"Redmine web site"&#58;http&#58;//www.redmine.org</strong> -- External link with different text: <a href="http://www.redmine.org" class="external">Redmine web site</a></li>
<li><strong>!http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org</strong> -- External image with a title that links to an URL:</li>
</ul>


<p style="text-align:center;"><a href="http://www.redmine.org"><img src="http://www.redmine.org/attachments/7069/Redmine_logo.png" title="Redmine web site" alt="Redmine web site" /></a></p>


<h3 >Email addresses</h3>


<p>Email addresses are automatically turned into clickable links:</p>


<ul>
<li><strong>someone&#64;foo.bar</strong> -- Link to an email address: <a class="email" href="mailto:someone@foo.bar">someone@foo.bar</a></li>
<li><strong>"Email someone"&#58;mailto&#58;someone&#64;foo.bar</strong> -- Email link with different text: <a href="mailto:someone@foo.bar">Email someone</a></li>
</ul>


More complex email instructions can be added to an email link. A default subject, default body and CC information can be defined. Note that spaces in any of these fields need to be replaced with the code %20.
<ul>
<li><strong>"Email webmaster and admin"&#58;mailto&#58;webmaster&#64;foo.bar?cc=admin&#64;foo.bar</strong> -- Email to webmaster, CC admin: <a href="mailto:webmaster@foo.bar?cc=admin@foo.bar">Email webmaster and admin</a></li>
<li><strong>"Email someone for help"&#58;mailto&#58;someone&#64;foo.bar?subject=Website%20Help</strong> -- Email link with the subject "Website Help": <a href="mailto:someone@foo.bar?subject=Website%20Help">Email someone for help</a></li>
<li><strong>"Email someone for help"&#58;mailto&#58;someone&#64;foo.bar?subject=Website%20Help&#38;body=My%20problem%20is%20</strong> -- Email link with the subject "Website Help" and a default body: <a href="mailto:someone@foo.bar?subject=Website%20Help&#38;body=My%20problem%20is%20">Email someone for help</a></li>
</ul>


<h2 >Text formatting</h2>


<p>For things such as headlines, bold, tables, lists, Redmine supports <a href="http://en.wikipedia.org/wiki/Textile_%28markup_language%29" class="external">Textile syntax</a>. See <a class="external" href="http://redcloth.org/hobix.com/textile/">http://redcloth.org/hobix.com/textile/</a> for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.</p>


<h3 >Acronym</h3>


<pre>
JPL(Jean-Philippe Lang)
</pre>

<p>displays:</p>


<p><abbr title="Jean-Philippe Lang">JPL</abbr></p>


<h3 >Font style</h3>


<pre><code>* *bold*
* _italic_
* *_bold italic_*
* +underline+
* -strike-through-
* Plain ^superscript^
* Plain ~subscript~
* @inline monospace@
* normal *bold* _italic_ normal;E=mc ^2^
* normal&lt;notextile&gt;&lt;/notextile&gt;*bold*&lt;notextile&gt;&lt;/notextile&gt;_italic_&lt;notextile&gt;&lt;/notextile&gt;normal;E=mc&lt;notextile&gt;&lt;/notextile&gt;^2^
* Escaping: &lt;notextile&gt;*bold* _italic_ @inlinemono@&lt;/notextile&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alternative using HTML-codes: &amp;#42;bold&amp;#42; &amp;#95;italic&amp;#95; &amp;#64;inlinemono&amp;#64;
* &lt;pre&gt;*some lines* some "link":http://www.redmine.org&lt;/pre&gt;
* &lt;pre&gt;&lt;notextile&gt;&lt;/notextile&gt;*some lines* some "link":http://www.redmine.org&lt;/pre&gt;<br /></code></pre>

<p>displays:</p>


<ul>
<li><strong>bold</strong></li>
<li><em>italic</em></li>
<li><strong><em>bold italic</em></strong></li>
<li><ins>underline</ins></li>
<li><del>strike-through</del></li>
<li>Plain <sup>superscript</sup></li>
<li>Plain <sub>subscript</sub></li>
<li><code>inline monospace</code></li>
<li>normal <strong>bold</strong> <em>italic</em> normal;E=mc <sup>2</sup></li>
<li>normal<strong>bold</strong><em>italic</em>normal;E=mc<sup>2</sup></li>
<li>Escaping: *bold* _italic_ @inlinemono@ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;</li>
<li><pre>*some lines* some "link":http://www.redmine.org</pre></li>
<li><pre><strong>some lines</strong> some <a href="http://www.redmine.org" class="external">link</a></pre></li>
</ul>


<h3 >Color</h3>


<pre><code>* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
* %{color:red}red%&lt;notextile&gt;&lt;/notextile&gt;%{color:green}green%&lt;notextile&gt;&lt;/notextile&gt;%{color:yellow}yellow%&lt;notextile&gt;&lt;/notextile&gt;%{color:#82B6E1}blue'ish%
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
* %{background:lightgreen}Lightgreen Background%&lt;notextile&gt;&lt;/notextile&gt;%{background:yellow}Yellow Background%
</code></pre>

<p>displays:</p>


<ul>
<li><span style="color:red;">red</span> <span style="color:green;">green</span> <span style="color:yellow;">yellow</span> <span style="color:#82B6E1;">blue'ish</span></li>
<li><span style="color:red;">red</span><span style="color:green;">green</span><span style="color:yellow;">yellow</span><span style="color:#82B6E1;">blue'ish</span></li>
<li><span style="background:lightgreen;">Lightgreen Background</span> <span style="background:yellow;">Yellow Background</span></li>
<li><span style="background:lightgreen;">Lightgreen Background</span><span style="background:yellow;">Yellow Background</span></li>
</ul>


<h3 >Inline images</h3>


<ul>
<li><strong>&#33;image_url&#33;</strong> displays an image located at image_url (textile syntax)</li>
<li><strong>&#33;>image_url&#33;</strong> right floating image</li>
<li><strong>&#33;image_url(Image title)&#33;</strong> displays an image with an alt/title attribute</li>
<li><strong>&#33;image_url&#33;:URL</strong> displays an image located at image_url with link URL added</li>
</ul>


<p>If you have an image attached to your wiki page, it can be displayed inline using its filename: <strong>&#33;attached_image.png&#33;</strong></p>


<p>You can also apply a CSS style to the image in the same ways as styling SPANs. The code <strong>&#33;{width: 100%}attached_image.png&#33;</strong> will make the image adjusts to the parent's width.</p>


<h3 >Headings</h3>


<pre><code>h1. Heading

h2. Subheading

h3. Subheading
</code></pre>

<p>Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.</p>


<h3 >Paragraphs</h3>


<pre><code>p. left aligned

p(. left ident 1em

p((. left ident 2em
as well as for following lines

p&gt;. right aligned

p)))&gt;. right ident 3em

p=. This is centered paragraph.
</code></pre>

<p>displays;</p>


<p>left aligned</p>


<p style="padding-left:1em;">left ident 1em</p>


<p style="padding-left:2em;">left ident 2em<br />as well as for following lines</p>


<p style="text-align:right;">right aligned</p>


<p style="padding-right:3em;text-align:right;">right ident 3em</p>


<p style="text-align:center;">This is centered paragraph.</p>


<h3 >Horizontal rule</h3>


<p><code>----</code></p>


<p>displays:</p>


<hr />


<h3 >Preformatted Text</h3>


<pre> &lt;pre&gt;*Your text won't become bold*&lt;/pre&gt; </pre>

<p>displays:</p>


<pre> *Your text won't become bold* </pre>

<h3 >Blockquotes</h3>


<p>Start the paragraph with <strong>bq.</strong>:</p>


<pre><code>bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
To go live, all you need to add is a database and a web server.
</code></pre>

<p>displays:</p>


<blockquote>
<p>Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.<br />To go live, all you need to add is a database and a web server.</p>
</blockquote>


<p>You can also use > at the beginning of each line and stack them for nested quotes:</p>


<pre>
&gt;&gt; Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
&gt;&gt; To go live, all you need to add is a database and a web server.
&gt; Great!
</pre>

<p>displays:</p>


<blockquote><blockquote>

<p>Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.<br />To go live, all you need to add is a database and a web server.</p>


</blockquote>

<p>Great!</p>


</blockquote>

<h3 >Unordered lists</h3>


<pre>
* Item 1
* Item 2
** Item 21
** Item 22
* Item 3
</pre>

<p>displays:</p>


<ul>
<li>Item 1</li>
<li>Item 2
<ul>
<li>Item 21</li>
<li>Item 22</li>
</ul>
</li>
<li>Item 3</li>
</ul>


<h3 >Ordered lists</h3>


<pre>
# Item 1
# Item 2
# Item 3
## Item 3.1
## Item 3.2
</pre>

<p>displays:</p>


<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3
<ol>
<li>Item 3.1</li>
<li>Item 3.2</li>
</ol></li>
</ol>


<h3 >Tables</h3>


<pre>
|_.UserID |_.Name |_.Group |_. attribute list |
|Starting with | a | simple |row |
|\3=.IT |&lt;. align left |
|1 |Artur Pirozhkov |/2.Users |&gt;. align right |
|2 |Vasya Rogov |=. center |
|3 |John Smith |Admin
(root) |^. valign top |
|4 |- |Nobody
(anonymous) |~. valign bottom |
</pre>

<p>displays (all multiple spaces are replaced by 1 space):</p>


<table>
<tr>
<th>UserID </th>
<th>Name </th>
<th>Group </th>
<th>attribute list </th>
</tr>
<tr>
<td>Starting with </td>
<td> a </td>
<td> simple </td>
<td>row </td>
</tr>
<tr>
<td style="text-align:center;" colspan="3">IT </td>
<td style="text-align:left;">align left </td>
</tr>
<tr>
<td>1 </td>
<td>Artur Pirozhkov </td>
<td rowspan="2">Users </td>
<td style="text-align:right;">align right </td>
</tr>
<tr>
<td>2 </td>
<td>Vasya Rogov </td>
<td style="text-align:center;">center </td>
</tr>
<tr>
<td>3 </td>
<td>John Smith </td>
<td>Admin<br /> (root) </td>
<td style="vertical-align:top;">valign top </td>
</tr>
<tr>
<td>4 </td>
<td>- </td>
<td>Nobody<br /> (anonymous) </td>
<td style="vertical-align:bottom;">valign bottom </td>
</tr>
</table>




<p>If you want to include pipe characters inside your table (e.g. for Wiki links), you need to prevent textile from interpreting them:</p>


<table>
<tr>
<th>Input </th>
<th>Output</th>
</tr>
<tr>
<td><strong>&lt;notextile&gt;|&lt;/notextile&gt;</strong></td>
<td>|</td>
</tr>
</table>




<h3 >Table of content</h3>


<pre><code>{{toc}} =&gt; left aligned toc
{{&gt;toc}} =&gt; right aligned toc
</code></pre>

<p>Please keep in mind, that the toc-tag needs an empty line above and underneath it and no other text before and after it.</p>


<p>Example:</p>


<pre><code>
h1. headLineOne

h2. something

{{toc}}

h2. something more
</code></pre>

<h2 >Macros</h2>


<p>Redmine includes a macros system that lets you add custom functions to insert dynamic content in formatted text. You can learn about writing your own macros in <a href="/projects/redmine/wiki/RedmineMacros" class="wiki-page">RedmineMacros</a>. Redmine also includes a few builtin macros:</p>


<p><dl><dt><code>hello_world</code></dt><dd><p>Sample macro.</p></dd><dt><code>macro_list</code></dt><dd><p>Displays a list of all available macros, including description if available.</p></dd><dt><code>child_pages</code></dt><dd><p>Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:</p>


<pre><code>!{{child_pages}} -- can be used from a wiki page only
!{{child_pages(depth=2)}} -- display 2 levels nesting only</code></pre></dd><dt><code>include</code></dt><dd><p>Include a wiki page. Example:</p>


<pre><code>!{{include(Foo)}}</code></pre>


<p>or to include a page of a specific project wiki:</p>


<pre><code>!{{include(projectname:Foo)}}</code></pre></dd><dt><code>collapse</code></dt><dd><p>Inserts of collapsed block of text. Example:</p>


<pre><code>{{collapse(View details...)
This is a block of text that is collapsed by default.
It can be expanded by clicking a link.
}}</code></pre></dd><dt><code>thumbnail</code></dt><dd><p>Displays a clickable thumbnail of an attached image. Examples:</p>


<pre>{{thumbnail(image.png)}}
{{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd><dt><code>sample_macro</code></dt><dd><p>Sample macro</p></dd></dl></p>


<h2 >Code highlighting</h2>


<p>Code highlighting relies on <a href="http://coderay.rubychan.de/" class="external">CodeRay</a>, a fast syntax highlighting library written completely in Ruby. It currently supports C, C++, CSS, Delphi, Diff, Groovy, HTML, Java, Javascript, JSON, Nitro-XHTML, PHP, Python, RHTML, Ruby, Scheme, SQL, XML and YAML code.</p>


<p>You can highlight code in your wiki page using this syntax:</p>


<pre><code>&lt;pre&gt;&lt;code class="ruby"&gt;
Place your code here.
&lt;/code&gt;&lt;/pre&gt;
</code></pre>

<p>Example:</p>


<pre><code class="ruby syntaxhl"><span class="CodeRay"><span class="comment"># The Greeter class</span>
<span class="keyword">class</span> <span class="class">Greeter</span>
<span class="keyword">def</span> <span class="function">initialize</span>(name)
<span class="instance-variable">@name</span> = name.capitalize
<span class="keyword">end</span>

<span class="keyword">def</span> <span class="function">salute</span>
puts <span class="string"><span class="delimiter">&quot;</span><span class="content">Hello </span><span class="inline"><span class="inline-delimiter">#{</span><span class="instance-variable">@name</span><span class="inline-delimiter">}</span></span><span class="content">!</span><span class="delimiter">&quot;</span></span>
<span class="keyword">end</span>
<span class="keyword">end</span>
</span></code></pre>
</body>
</html>
(1-1/3)