RedmineTextFormattingMarkdown » History » Version 17

Version 16 (Hiroo Hayashi, 2016-07-23 06:12) → Version 17/21 (Hiroo Hayashi, 2016-07-23 11:57)

h1. Markdown formatting

Below is copy of *Textile* formatting that needs to be updated to *Markdown* formatting. For *Textile* formatting see [[RedmineTextFormattingTextile|Textile formatting]]. Please help.
Currently HTML tags are not allowed by default. See #15520 and #20497 for details. For other limitations of the current *Markdown* formatting see #15520, #16373 and #21443.

{{>TOC}}

h2. Links

h3. Redmine links

{{include(RedmineTextFormattingRedmineLinks)}}

h3. External links

HTTP URLs are automatically turned into clickable links:


* *http://www.redmine.org* -- External link to the redmine website: http://www.redmine.org
* *someone@foo.bar* -- Link to an email address: someone@foo.bar


HTTP URLs can also use different text than the link itself:


* *[Redmine web site](http://www.redmine.org)* -- External link with different text: "Redmine web site":http://www.redmine.org
* *[![Redmine web site](http://www.redmine.org/attachments/7069/Redmine_logo.png)](http://www.redmine.org)* -- External image with a title that links to an URL:

p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org

h3. Email addresses

Email addresses are automatically turned into clickable links:

* *someone@foo.bar* -- Link to an email address: someone@foo.bar
*
*[Email someone](mailto:someone@foo.bar)* -- Email link with different text: "Email someone":mailto:someone@foo.bar

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.
* *[Email webmaster and admin](mailto:webmaster@foo.bar?cc=admin@foo.bar)* -- Email to webmaster, CC admin: "Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar
* *[Email someone for help](mailto:someone@foo.bar?subject=Website%20Help)* -- Email link with the subject "Website Help": "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help
* *[Email someone for help](mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20)* -- Email link with the subject "Website Help" and a default body: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20

h2. Text formatting

For things such as headlines, bold, tables, lists, Redmine supports "Markdown syntax":http://en.wikipedia.org/wiki/Markdown. See http://daringfireball.net/projects/markdown/syntax, http://agea.github.io/tutorial.md/, http://stackoverflow.com/editing-help for information on using any of these features. A few samples are included below, but the engine is capable of much more of that. For conversions see "Pandoc":http://pandoc.org. The "Redcarpet formatter":https://github.com/alminium/redmine_redcarpet_formatter is used.

h3. Acronym

Not supported by ?? in Markdown

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

Display:

JPL(Jean-Philippe Lang)

h3. Font style

<pre><code>* **bold** __bold__
* *italic* _italic_
* ***bold italic*** ___bold italic___
* <ins>underline</ins>
* <del>strike through</del>
* Plain <sup>superscript</sup>
* Plain <sub>subscript</sub>
* `inline monospace`
* normal **bold** _italic_ normal;E=mc<sup>2</sup>
* <notextile>normal<notextile></notextile>**bold**<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<sup>2</sup></notextile> &lt;notextile&gt;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^&lt;/notextile&gt;
* Escaping: \*\*bold\*\* \_italic\_ \`inlinemono\` &lt;notextile&gt;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;/notextile&gt;
* <notextile><pre>**some lines** &lt;notextile&gt;&lt;pre&gt;*some lines* some [link](http://www.redmine.org)</pre></notextile> &quot;link&quot;:http://www.redmine.org&lt;/pre&gt;&lt;/notextile&gt;
* <notextile><pre>\*\*some lines\*\* &lt;notextile&gt;&lt;pre&gt;&lt;notextile&gt;&lt;/notextile&gt;*some lines* some \[link](http\://www\.redmine\.org)</pre></notextile> &quot;link&quot;:http://www.redmine.org&lt;/pre&gt;&lt;/notextile&gt;
</code></pre>

displays: Display:

* *bold* *bold*
* _italic_ _italic_
* *_bold italic_* *_bold italic_*
* +underline+
* -strike-through-
* Plain ^superscript^
* Plain ~subscript~
* @inline monospace@
* normal *bold* _italic_ normal;E=mc<notextile></notextile>^2^ normal;E=mc ^2^
* normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
* Escaping: <notextile>*bold* _italic_ `inlinemono`</notextile>
@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;
* <pre><notextile></notextile>*some &lt;pre&gt;*some lines* some "link":http://www.redmine.org</pre>
* <pre>**some lines** &lt;pre&gt;&lt;notextile&gt;&lt;/notextile&gt;*some lines* some [link](http://www.redmine.org)</pre> &quot;link&quot;:http://www.redmine.org&lt;/pre&gt;

**Note:** HTML tags need to be allowed to use the HTML tags (<ins>, <del>, <sup>, <sub>). See #15520-16 and #15520-17 for details.

h3. Color Colour

<pre><code><notextile>* <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> %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue&#x27;ish%
* <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> %{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&#x27;ish%
* <span style="background-color:lightgreen">Lightgreen Background</span> <span style="background-color:yellow">Yellow Background</span> %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
* <span style="background-color:lightgreen">Lightgreen Background</span><span style="background-color:yellow">Yellow Background</span> %{background:lightgreen}Lightgreen Background%&lt;notextile&gt;&lt;/notextile&gt;%{background:yellow}Yellow Background%
</notextile></code></pre>

displays: Display:

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

**Note:** HTML tags need to be allowed to use the HTML tag (<span>). See #15520-16 and #15520-17 for details.

h3. Inline images

* *![](image_url)* displays an image located at image_url (textile syntax)
* *![alt text](image_url "optional title")* *![](image_url)* right floating image, see http://stackoverflow.com/questions/255170/markdown-and-image-alignment
* *![Image title](image_url)*
displays an image with an alt/title attribute
* *[![](image_url)](URL)* *&amp;#33;image_url&amp;#33;:URL* displays an image located at image_url with link URL added

If you have an image attached to your wiki page, it can be displayed inline using its filename: *![](attached_image.png)*. *&amp;#33;attached_image.png&amp;#33;*

As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you You can use regular HTML <img> tags.

* <img style="float:right" src="URL"/>
* <img style="width:100%" src="attached_image.png"/>

**Note:** HTML tags need
also apply a CSS style to be allowed the image in the same ways as styling SPANs. The code *&amp;#33;{width: 100%}attached_image.png&amp;#33;* will make the image adjusts to use the HTML tag (<img>). See #15520-16 and #15520-17 for details.

parent&#x27;s width.

h3. Headings

<pre><code># Heading

## Subheading

### Subheading

or

Heading
=======

Subheading
----------
</code></pre>

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

h3. Paragraphs

Markdown does not support alignment of a paragraph. Use &lt;div> tags if you need it.

<pre><code>left aligned
<div style="padding-left:1em;">
&lt;pre&gt;&lt;code&gt;p. left ident 1em
</div>

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

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

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

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

displays;

p. left aligned



p(. left ident 1em



p((. left ident 2em

as well as for following lines



p>. right aligned



p)))>. right ident 3em



p=. This is centered paragraph.
&lt;/code&gt;&lt;/pre&gt;


**Note:** HTML tags need to be allowed to use the HTML tags (<div>). See #15520-16 and #15520-17 for details.

h3. Horizontal rule

@----@

displays:

Display:


----



h3. Preformatted Text Predefined

To escape wiki syntax
<pre> <pre>**Your &lt;pre&gt; *Your text won't become bold**</pre> bold* </pre> &lt;/pre&gt;
Display:


displays:

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

h3. Blockquotes

Start the paragraph with *bq.*:

&lt;pre&gt;&lt;code&gt;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.
&lt;/code&gt;&lt;/pre&gt;

Displays:

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.

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

<pre>
>> 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.
> Great!
</pre>

displays: Displays:

>> 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.
> Great!

h3. Unordered lists

Unordered lists use asterisks (@*@), pluses (@+@), and hyphens (@-@) as list markers

<pre>
* Item 1
* Item 2
* Item 21 (two spaces indentation)
* Item 22
* Item 3
</pre>

displays:

* Item 1
* Item 2
** Item 21
** Item 22
* Item 3

h3. Ordered lists

Ordered lists use numbers followed by periods.

<pre>
1. # Item 1
3. # Item 2
2. # Item 3
1. # Item 3.1 (two spaces)
1. # Item 3.2
</pre>

displays:

# Item 1
# Item 2
# Item 3
## Item 3.1
## Item 3.2

Note that the actual numbers you use to mark the list have no effect on the output.

h3. Tables

Markdown does not have syntax for &lt;pre&gt;
|_.UserID |_.Name |_.Group |_. attribute list |
|Starting with |
a table. Use an HTML table to write a table.

<pre><code><table>
<tr><td style="text-align:center;"><strong>UserID</strong></td><td style="text-align:center;"><strong>Name</strong></td><td style="text-align:center;"><strong>Group</strong></td><td style="text-align:center;"><strong>attribute list</strong></td></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>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 rowspan="2">3</td><td rowspan="2">John Smith</td><td>Admin</td><td style="vertical-align:top;" rowspan="2">valign top</td></tr>
<tr><td>(root)</td></tr>
<tr><td rowspan="2">4</td><td rowspan="2">-</td><td>Nobody</td><td style="vertical-align:bottom;" rowspan="2">valign bottom</td></tr>
<tr><td>(anonymous)</td></tr>
| simple |row |
</table> |\3=.IT |&lt;. align left |
</code></pre>

displays;

|1 |Artur Pirozhkov |/2.Users |&gt;. align right |
|2 |Vasya Rogov
|=. *UserID* center |=. *Name* |
|3 |John Smith |Admin
(root) |^. valign top
|=. *Group* |=. *attribute list* |
|4 |- |Nobody
(anonymous) |~. valign bottom |
&lt;/pre&gt;

displays (all multiple spaces are replaced by 1 space):

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

**Note:** HTML tags If you want to include pipe characters inside your table (e.g. for Wiki links), you need to be allowed to use the HTML tags (<table>, <tr>, <td>). See #15520-16 and #15520-17 for details. prevent textile from interpreting them:

|_.Input |_. Output|
|*&lt;notextile&gt;&lt;notextile&gt;|&lt;/notextile&gt;&lt;/notextile&gt;*|&lt;notextile&gt;|&lt;/notextile&gt;|

h3. Table of content

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

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

Example:

<pre><code>h1. &lt;pre&gt;&lt;code&gt;
h1.
headLineOne

h2. something

{{toc}}

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

h2. Macros

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 [[RedmineMacros]]. Redmine also includes a few builtin macros:

{{macro_list}}

h2. Code highlighting

Code highlighting relies on "CodeRay":http://coderay.rubychan.de/, 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.

You can highlight code in your wiki page using this syntax:

<pre><code>``` ruby
Place your code here.
```</code></pre>

Example:

<pre><code class="ruby">
# The Greeter class
class Greeter
def initialize(name)
@name = name.capitalize
end

def salute
puts "Hello #{@name}!"
end
end
</code></pre>

h2. Textile formatting

Redmine supports textile formatting. For details see &quot;Textile syntax&quot;:http://en.wikipedia.org/wiki/Textile_%28markup_language%29

Additional supported textiles:
* *&lt;notextile&gt;%&lt;/notextile&gt;{background:lightgreen}Green Background%* displays %{background:lightgreen}Green Background%


h2. Translation

Note that the following translations may not be up to date. Please refer to the original english documentation if needed.

* [[BrRedmineWikiFormatting|Português Brasileiro]]
* [[RusRedmineTextFormatting|Русский]]
* [[FrRedmineWikiFormatting|French]]
* [[KoreanWikiFormatting|Korean]]
* [[TurkishWikiFormatting|Türkçe]]
* [[TraditionalChineseWikiFormatting|繁體中文]]
* [[SimplifiedChineseWikiFormatting|简体中文]]