Project

General

Profile

Feature #40149 » 0001-Remove-Redcarpet-based-Markdown-formatter.patch

Go MAEDA, 2024-10-10 13:40

View differences:

Gemfile
44 44
  gem 'mini_magick', '~> 5.0.1'
45 45
end
46 46

  
47
# Optional Markdown support
48
group :markdown do
49
  gem 'redcarpet', '~> 3.6.0'
50
end
51

  
52 47
# Optional CommonMark support, not for JRuby
53 48
group :common_mark do
54 49
  gem "commonmarker", '~> 0.23.8'
app/assets/javascripts/jstoolbar/markdown.js
1
/**
2
 * This file is part of DotClear.
3
 * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All rights reserved.
4
 * This code is released under the GNU General Public License.
5
 *
6
 * Modified by JP LANG for markdown formatting
7
 */
8

  
9
// strong
10
jsToolBar.prototype.elements.strong = {
11
  type: 'button',
12
  title: 'Strong',
13
  shortcut: 'b',
14
  fn: {
15
    wiki: function() { this.singleTag('**') }
16
  }
17
}
18

  
19
// em
20
jsToolBar.prototype.elements.em = {
21
  type: 'button',
22
  title: 'Italic',
23
  shortcut: 'i',
24
  fn: {
25
    wiki: function() { this.singleTag("*") }
26
  }
27
}
28

  
29
// ins
30
jsToolBar.prototype.elements.ins = {
31
  type: 'button',
32
  title: 'Underline',
33
  shortcut: 'u',
34
  fn: {
35
    wiki: function() { this.singleTag('_') }
36
  }
37
}
38

  
39
// del
40
jsToolBar.prototype.elements.del = {
41
  type: 'button',
42
  title: 'Deleted',
43
  fn: {
44
    wiki: function() { this.singleTag('~~') }
45
  }
46
}
47

  
48
// code
49
jsToolBar.prototype.elements.code = {
50
  type: 'button',
51
  title: 'Code',
52
  fn: {
53
    wiki: function() { this.singleTag('`') }
54
  }
55
}
56

  
57
// spacer
58
jsToolBar.prototype.elements.space1 = {type: 'space'}
59

  
60
// headings
61
jsToolBar.prototype.elements.h1 = {
62
  type: 'button',
63
  title: 'Heading 1',
64
  fn: {
65
    wiki: function() {
66
      this.encloseLineSelection('# ', '',function(str) {
67
        str = str.replace(/^#+\s+/, '')
68
        return str;
69
      });
70
    }
71
  }
72
}
73
jsToolBar.prototype.elements.h2 = {
74
  type: 'button',
75
  title: 'Heading 2',
76
  fn: {
77
    wiki: function() {
78
      this.encloseLineSelection('## ', '',function(str) {
79
        str = str.replace(/^#+\s+/, '')
80
        return str;
81
      });
82
    }
83
  }
84
}
85
jsToolBar.prototype.elements.h3 = {
86
  type: 'button',
87
  title: 'Heading 3',
88
  fn: {
89
    wiki: function() {
90
      this.encloseLineSelection('### ', '',function(str) {
91
        str = str.replace(/^#+\s+/, '')
92
        return str;
93
      });
94
    }
95
  }
96
}
97

  
98
// spacer
99
jsToolBar.prototype.elements.space2 = {type: 'space'}
100

  
101
// ul
102
jsToolBar.prototype.elements.ul = {
103
  type: 'button',
104
  title: 'Unordered list',
105
  fn: {
106
    wiki: function() {
107
      this.encloseLineSelection('','',function(str) {
108
        str = str.replace(/\r/g,'');
109
        return str.replace(/(\n|^)[#-]?\s*/g,"$1* ");
110
      });
111
    }
112
  }
113
}
114

  
115
// ol
116
jsToolBar.prototype.elements.ol = {
117
  type: 'button',
118
  title: 'Ordered list',
119
  fn: {
120
    wiki: function() {
121
      this.encloseLineSelection('','',function(str) {
122
        str = str.replace(/\r/g,'');
123
        return str.replace(/(\n|^)[*-]?\s*/g,"$11. ");
124
      });
125
    }
126
  }
127
}
128

  
129
// spacer
130
jsToolBar.prototype.elements.space3 = {type: 'space'}
131

  
132
// bq
133
jsToolBar.prototype.elements.bq = {
134
  type: 'button',
135
  title: 'Quote',
136
  fn: {
137
    wiki: function() {
138
      this.encloseLineSelection('','',function(str) {
139
        str = str.replace(/\r/g,'');
140
        return str.replace(/(\n|^)( *)([^\n]*)/g,"$1> $2$3");
141
      });
142
    }
143
  }
144
}
145

  
146
// unbq
147
jsToolBar.prototype.elements.unbq = {
148
  type: 'button',
149
  title: 'Unquote',
150
  fn: {
151
    wiki: function() {
152
      this.encloseLineSelection('','',function(str) {
153
        str = str.replace(/\r/g,'');
154
        return str.replace(/(\n|^) *(> ?)?( *)([^\n]*)/g,"$1$3$4");
155
      });
156
    }
157
  }
158
}
159

  
160
// table
161
jsToolBar.prototype.elements.table = {
162
  type: 'button',
163
  title: 'Table',
164
  fn: {
165
    wiki: function() {
166
      var This = this;
167
      this.tableMenu(function(cols, rowCount){
168
        This.encloseLineSelection(
169
          '|'+cols.join(' |')+' |\n' +                                   // header
170
          Array(cols.length+1).join('|--')+'|\n' +                       // second line
171
          Array(rowCount+1).join(Array(cols.length+1).join('|  ')+'|\n') // cells
172
        );
173
      });
174
    }
175
  }
176
}
177

  
178
// pre
179
jsToolBar.prototype.elements.pre = {
180
  type: 'button',
181
  title: 'Preformatted text',
182
  fn: {
183
    wiki: function() { this.encloseLineSelection('```\n', '\n```') }
184
  }
185
}
186

  
187
// Code highlighting
188
jsToolBar.prototype.elements.precode = {
189
  type: 'button',
190
  title: 'Highlighted code',
191
  fn: {
192
    wiki: function() {
193
      var This = this;
194
      this.precodeMenu(function(lang){
195
        This.encloseLineSelection('``` ' + lang + '\n', '\n```\n');
196
      });
197
    }
198
  }
199
}
200

  
201
// spacer
202
jsToolBar.prototype.elements.space4 = {type: 'space'}
203

  
204
// wiki page
205
jsToolBar.prototype.elements.link = {
206
  type: 'button',
207
  title: 'Wiki link',
208
  fn: {
209
    wiki: function() { this.encloseSelection("[[", "]]") }
210
  }
211
}
212
// image
213
jsToolBar.prototype.elements.img = {
214
  type: 'button',
215
  title: 'Image',
216
  fn: {
217
    wiki: function() { this.encloseSelection("![](", ")") }
218
  }
219
}
220

  
221
// spacer
222
jsToolBar.prototype.elements.space5 = {type: 'space'}
223
// help
224
jsToolBar.prototype.elements.help = {
225
  type: 'button',
226
  title: 'Help',
227
  fn: {
228
    wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') }
229
  }
230
}
app/helpers/application_helper.rb
1930 1930
    )
1931 1931
  end
1932 1932

  
1933
  # Returns the markdown formatter: markdown or common_mark
1934
  # ToDo: Remove this when markdown will be removed
1935
  def markdown_formatter
1936
    if Setting.text_formatting == "markdown"
1937
      "markdown"
1938
    else
1939
      "common_mark"
1940
    end
1941
  end
1942

  
1943 1933
  private
1944 1934

  
1945 1935
  def wiki_helper
app/helpers/attachments_helper.rb
91 91

  
92 92
  def render_file_content(attachment, content)
93 93
    if attachment.is_markdown?
94
      render :partial => 'common/markup', :locals => {:markup_text_formatting => markdown_formatter, :markup_text => content}
94
      render :partial => 'common/markup', :locals => {:markup_text_formatting => 'common_mark', :markup_text => content}
95 95
    elsif attachment.is_textile?
96 96
      render :partial => 'common/markup', :locals => {:markup_text_formatting => 'textile', :markup_text => content}
97 97
    else
app/views/help/wiki_syntax/markdown/bg/wiki_syntax_detailed_markdown.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title>RedmineWikiFormatting (Markdown)</title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<%= stylesheet_link_tag "wiki_syntax_detailed.css" %>
7
</head>
8

  
9
<body>
10
<h1><a name="1" class="wiki-page"></a>Wiki formatting (Markdown)</h1>
11

  
12
    <ul class='toc'>
13
        <li><a href='#2'>Links</a></li>
14
        <ul>
15
            <li><a href='#3'>Redmine links</a></li>
16
            <li><a href='#4'>External links</a></li>
17
        </ul>
18
        <li><a href='#5'>Text formatting</a></li>
19
        <ul>
20
            <li><a href='#6'>Font style</a></li>
21
            <li><a href='#7'>Inline images</a></li>
22
            <li><a href='#8'>Headings</a></li>
23
            <li><a href='#10'>Blockquotes</a></li>
24
            <li><a href='#11'>Table of content</a></li>
25
            <li><a href='#14'>Horizontal Rule</a></li>
26
        </ul>
27
        <li><a href='#12'>Macros</a></li>
28
        <li><a href='#13'>Code highlighting</a></li>
29
    </ul>
30

  
31
    <h2><a name="2" class="wiki-page"></a>Links</h2>
32

  
33
        <h3><a name="3" class="wiki-page"></a>Redmine links</h3>
34

  
35
        <p>Redmine allows hyperlinking between resources (issues, changesets, wiki pages...) from anywhere wiki formatting is used.</p>
36
        <ul>
37
            <li>Link to an issue: <strong>#124</strong> (displays <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del>, link is striked-through if the issue is closed)</li>
38
            <li>Link to an issue including tracker name and subject: <strong>##124</strong> (displays <a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (New)">Bug #124</a>: bulk edit doesn't change the category or fixed version properties)</li>
39
            <li>Link to an issue note: <strong>#124-6</strong>, or <strong>#124#note-6</strong></li>
40
            <li>Link to an issue note within the same issue: <strong>#note-6</strong></li>
41
        </ul>
42

  
43
        <p>Wiki links:</p>
44

  
45
        <ul>
46
            <li><strong>[[Guide]]</strong> displays a link to the page named 'Guide': <a href="#" class="wiki-page">Guide</a></li>
47
            <li><strong>[[Guide#further-reading]]</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <a href="#" class="wiki-page">Guide</a></li>
48
            <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
49
            <li><strong>[[Guide|User manual]]</strong> displays a link to the same page but with a different text: <a href="#" class="wiki-page">User manual</a></li>
50
        </ul>
51

  
52
        <p>You can also link to pages of an other project wiki:</p>
53

  
54
        <ul>
55
            <li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
56
            <li><strong>[[sandbox:]]</strong> displays a link to the Sandbox wiki main page</li>
57
        </ul>
58

  
59
        <p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="#" class="wiki-page new">Nonexistent page</a>.</p>
60

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

  
63
        <ul>
64
            <li>Documents:
65
                <ul>
66
                    <li><strong>document#17</strong> (link to document with id 17)</li>
67
                    <li><strong>document:Greetings</strong> (link to the document with title "Greetings")</li>
68
                    <li><strong>document:"Some document"</strong> (double quotes can be used when document title contains spaces)</li>
69
                    <li><strong>sandbox:document:"Some document"</strong> (link to a document with title "Some document" in other project "sandbox")</li>
70
                </ul>
71
            </li>
72
        </ul>
73

  
74
        <ul>
75
            <li>Versions:
76
                <ul>
77
                    <li><strong>version#3</strong> (link to version with id 3)</li>
78
                    <li><strong>version:1.0.0</strong> (link to version named "1.0.0")</li>
79
                    <li><strong>version:"1.0 beta 2"</strong></li>
80
                    <li><strong>sandbox:version:1.0.0</strong> (link to version "1.0.0" in the project "sandbox")</li>
81
                </ul>
82
            </li>
83
        </ul>
84

  
85
        <ul>
86
            <li>Attachments:
87
                <ul>
88
                    <li><strong>attachment:file.zip</strong> (link to the attachment of the current object named file.zip)</li>
89
                    <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>
90
                </ul>
91
            </li>
92
        </ul>
93

  
94
        <ul>
95
            <li>Changesets:
96
                <ul>
97
                    <li><strong>r758</strong>                       (link to a changeset)</li>
98
                    <li><strong>commit:c6f4d0fd</strong>            (link to a changeset with a non-numeric hash)</li>
99
                    <li><strong>svn1|r758</strong>                  (link to a changeset of a specific repository, for projects with multiple repositories)</li>
100
                    <li><strong>commit:hg|c6f4d0fd</strong>         (link to a changeset with a non-numeric hash of a specific repository)</li>
101
                    <li><strong>sandbox:r758</strong>               (link to a changeset of another project)</li>
102
                    <li><strong>sandbox:commit:c6f4d0fd</strong>    (link to a changeset with a non-numeric hash of another project)</li>
103
                </ul>
104
            </li>
105
        </ul>
106

  
107
        <ul>
108
             <li>Repository files:
109
                <ul>
110
                    <li><strong>source:some/file</strong>           (link to the file located at /some/file in the project's repository)</li>
111
                    <li><strong>source:some/file@52</strong>        (link to the file's revision 52)</li>
112
                    <li><strong>source:some/file#L120</strong>      (link to line 120 of the file)</li>
113
                    <li><strong>source:some/file@52#L120</strong>   (link to line 120 of the file's revision 52)</li>
114
                    <li><strong>source:"some file@52#L120"</strong> (use double quotes when the URL contains spaces</li>
115
                    <li><strong>export:some/file</strong>           (force the download of the file)</li>
116
                    <li><strong>source:svn1|some/file</strong>      (link to a file of a specific repository, for projects with multiple repositories)</li>
117
                    <li><strong>sandbox:source:some/file</strong>   (link to the file located at /some/file in the repository of the project "sandbox")</li>
118
                    <li><strong>sandbox:export:some/file</strong>   (force the download of the file)</li>
119
                </ul>
120
            </li>
121
        </ul>
122

  
123
        <ul>
124
            <li>Forums:
125
                <ul>
126
                    <li><strong>forum#1</strong> (link to forum with id 1</li>
127
                    <li><strong>forum:Support</strong> (link to forum named Support)</li>
128
                    <li><strong>forum:"Technical Support"</strong> (use double quotes if forum name contains spaces)</li>
129
                </ul>
130
            </li>
131
        </ul>
132

  
133
        <ul>
134
            <li>Forum messages:
135
                <ul>
136
                    <li><strong>message#1218</strong> (link to message with id 1218)</li>
137
                </ul>
138
            </li>
139
        </ul>
140

  
141
        <ul>
142
            <li>Projects:
143
                <ul>
144
                    <li><strong>project#3</strong> (link to project with id 3)</li>
145
                    <li><strong>project:some-project</strong> (link to project with name or slug of "some-project")</li>
146
                    <li><strong>project:"Some Project"</strong> (use double quotes for project name containing spaces)</li>
147
                </ul>
148
             </li>
149
        </ul>
150

  
151
        <ul>
152
            <li>News:
153
                <ul>
154
                    <li><strong>news#2</strong> (link to news item with id 2)</li>
155
                    <li><strong>news:Greetings</strong> (link to news item named "Greetings")</li>
156
                    <li><strong>news:"First Release"</strong> (use double quotes if news item name contains spaces)</li>
157
                </ul>
158
            </li>
159
        </ul>
160

  
161
        <ul>
162
            <li>Users:
163
                <ul>
164
                    <li><strong>user#2</strong> (link to user with id 2)</li>
165
                    <li><strong>user:jsmith</strong> (Link to user with login jsmith)</li>
166
                    <li><strong>@jsmith</strong> (Link to user with login jsmith)</li>
167
                </ul>
168
            </li>
169
        </ul>
170

  
171
        <p>Escaping:</p>
172

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

  
177

  
178
        <h3><a name="4" class="wiki-page"></a>External links</h3>
179

  
180
        <p>URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:</p>
181

  
182
<pre>
183
http://www.redmine.org, someone@foo.bar
184
</pre>
185

  
186
        <p>displays: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
187

  
188
        <p>If you want to display a specific text instead of the URL, you can use the standard markdown syntax:</p>
189

  
190
<pre>
191
[Redmine web site](http://www.redmine.org)
192
</pre>
193

  
194
        <p>displays: <a href="http://www.redmine.org" class="external">Redmine web site</a></p>
195

  
196

  
197
    <h2><a name="5" class="wiki-page"></a>Text formatting</h2>
198

  
199

  
200
    <p>For things such as headlines, bold, tables, lists, Redmine supports Markdown syntax.  See <a class="external" href="http://daringfireball.net/projects/markdown/syntax">http://daringfireball.net/projects/markdown/syntax</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>
201

  
202
        <h3><a name="6" class="wiki-page"></a>Font style</h3>
203

  
204
<pre>
205
* **bold**
206
* *Italic*
207
* ***bold italic***
208
* _underline_
209
* ~~strike-through~~
210
</pre>
211

  
212
        <p>Display:</p>
213

  
214
        <ul>
215
            <li><strong>bold</strong></li>
216
            <li><em>italic</em></li>
217
            <li><em><strong>bold italic</strong></em></li>
218
            <li><u>underline</u></li>
219
            <li><del>strike-through</del></li>
220
        </ul>
221

  
222
        <h3><a name="7" class="wiki-page"></a>Inline images</h3>
223

  
224
        <ul>
225
            <li><strong>![](image_url)</strong> displays an image located at image_url (markdown syntax)</li>
226
            <li>If you have an image attached to your wiki page, it can be displayed inline using its filename: <strong>![](attached_image)</strong></li>
227
            <li>Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v (note that Internet Explorer is not supported).</li>
228
            <li>Image files can be dragged onto the text area in order to be uploaded and embedded.</li>
229
        </ul>
230

  
231
        <h3><a name="8" class="wiki-page"></a>Headings</h3>
232

  
233
<pre>
234
# Heading
235
## Subheading
236
### Subsubheading
237
</pre>
238

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

  
241

  
242
        <h3><a name="10" class="wiki-page"></a>Blockquotes</h3>
243

  
244
        <p>Start the paragraph with <strong>&gt;</strong></p>
245

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

  
251
        <p>Display:</p>
252

  
253
        <blockquote>
254
                <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>
255
        </blockquote>
256

  
257

  
258
        <h3><a name="11" class="wiki-page"></a>Table of content</h3>
259

  
260
<pre>
261
{{toc}} =&gt; left aligned toc
262
{{&gt;toc}} =&gt; right aligned toc
263
</pre>
264

  
265
        <h3><a name="14" class="wiki-page"></a>Horizontal Rule</h3>
266

  
267
<pre>
268
---
269
</pre>
270

  
271
    <h2><a name="12" class="wiki-page"></a>Macros</h2>
272

  
273
    <p>Redmine has the following builtin macros:</p>
274

  
275
    <p>
276
    <dl>
277
      <dt><code>hello_world</code></dt>
278
      <dd><p>Sample macro.</p></dd>
279

  
280
      <dt><code>macro_list</code></dt>
281
      <dd><p>Displays a list of all available macros, including description if available.</p></dd>
282

  
283
      <dt><code>child_pages</code></dt>
284
      <dd><p>Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:</p>
285
      <pre><code>{{child_pages}} -- can be used from a wiki page only
286
{{child_pages(depth=2)}} -- display 2 levels nesting only</code></pre></dd>
287

  
288
      <dt><code>include</code></dt>
289
      <dd><p>Include a wiki page. Example:</p>
290
      <pre><code>{{include(Foo)}}</code></pre>
291
      <p>or to include a page of a specific project wiki:</p>
292
      <pre><code>{{include(projectname:Foo)}}</code></pre></dd>
293

  
294
      <dt><code>collapse</code></dt>
295
      <dd><p>Inserts of collapsed block of text. Example:</p>
296
      <pre><code>{{collapse(View details...)
297
This is a block of text that is collapsed by default.
298
It can be expanded by clicking a link.
299
}}</code></pre></dd>
300

  
301
      <dt><code>thumbnail</code></dt>
302
      <dd><p>Displays a clickable thumbnail of an attached image. Examples:</p>
303
      <pre>{{thumbnail(image.png)}}
304
{{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd>
305

  
306
      <dt><code>issue</code></dt>
307
      <dd><p>Inserts a link to an issue with flexible text. Examples:</p>
308
      <pre>{{issue(123)}}                              -- Issue #123: Enhance macro capabilities
309
{{issue(123, project=true)}}                -- Andromeda - Issue #123:Enhance macro capabilities
310
{{issue(123, tracker=false)}}               -- #123: Enhance macro capabilities
311
{{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123</pre></dd>
312
    </dl>
313
    </p>
314

  
315
    <h2><a name="13" class="wiki-page"></a>Code highlighting</h2>
316

  
317
    <p>Default code highlighting relies on <a href="http://rouge.jneen.net/" class="external">Rouge</a>, a pure Ruby code highlighter. Rouge supports many commonly used languages such as <strong>c</strong>, <strong>cpp</strong> (c++), <strong>csharp</strong> (c#, cs), <strong>css</strong>, <strong>diff</strong> (patch, udiff), <strong>go</strong> (golang), <strong>groovy</strong>, <strong>html</strong>, <strong>java</strong>, <strong>javascript</strong> (js), <strong>kotlin</strong>, <strong>objective_c</strong> (objc), <strong>perl</strong> (pl), <strong>php</strong>, <strong>python</strong> (py), <strong>r</strong>, <strong>ruby</strong> (rb), <strong>sass</strong>, <strong>scala</strong>, <strong>shell</strong> (bash, zsh, ksh, sh), <strong>sql</strong>, <strong>swift</strong>, <strong>xml</strong> and <strong>yaml</strong> (yml) languages - the names inside parentheses are aliases. Please refer to the <a href="<%= help_code_highlighting_path %>" target="_blank">list of languages supported by Redmine code highlighter</a>.</p>
318

  
319
    <p>You can highlight code at any place that supports wiki formatting using this syntax (note that the language name or alias is case-insensitive):</p>
320

  
321
<pre>
322
``` ruby
323
  Place your code here.
324
```
325
</pre>
326

  
327
    <p>Example:</p>
328

  
329
<pre><code class="ruby syntaxhl"><span class="c1"># The Greeter class</span>
330
<span class="k">class</span> <span class="nc">Greeter</span>
331
  <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
332
    <span class="vi">@name</span> <span class="o">=</span> <span class="nb">name</span><span class="p">.</span><span class="nf">capitalize</span>
333
  <span class="k">end</span>
334

  
335
  <span class="k">def</span> <span class="nf">salute</span>
336
    <span class="nb">puts</span> <span class="s2">"Hello </span><span class="si">#{</span><span class="vi">@name</span><span class="si">}</span><span class="s2">!"</span>
337
  <span class="k">end</span>
338
<span class="k">end</span>
339
</code></pre>
340
</body>
341
</html>
app/views/help/wiki_syntax/markdown/bg/wiki_syntax_markdown.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<title>Wiki formatting</title>
6
<%= stylesheet_link_tag "wiki_syntax.css" %>
7
</head>
8
<body>
9

  
10
<h1>Wiki Syntax Quick Reference (Markdown)</h1>
11

  
12
<table style="width:100%">
13
<tr><th colspan="3">Font Styles <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "5") %>" target="_blank">more</a>)</span></th></tr>
14
<tr><th><%= image_tag("jstoolbar/bt_strong.png", { alt: "Strong" }) %></th><td style="width:50%;">**Strong**</td><td style="width:50%;"><strong>Strong</strong></td></tr>
15
<tr><th><%= image_tag("jstoolbar/bt_em.png", { alt: "Italic" }) %></th><td>*Italic*</td><td><em>Italic</em></td></tr>
16
<tr><th><%= image_tag("jstoolbar/bt_ins.png", { alt: "Underline" }) %></th><td>_Underline_</td><td><ins>Underline</ins></td></tr>
17
<tr><th><%= image_tag("jstoolbar/bt_del.png", { alt: "Deleted" }) %></th><td>~~Deleted~~</td><td><del>Deleted</del></td></tr>
18
<tr><th><%= image_tag("jstoolbar/bt_code.png", { alt: "Inline code" }) %></th><td>`Inline Code`</td><td><code>Inline Code</code></td></tr>
19
<tr><th><%= image_tag("jstoolbar/bt_pre.png", { alt: "Preformatted text" }) %></th><td>```<br />&nbsp;lines<br />&nbsp;of code<br />```</td><td>
20
<pre>
21
 lines
22
 of code
23
</pre>
24
</td></tr>
25

  
26
<tr><th colspan="3">Highlighted code <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "13") %>" target="_blank">more</a> | <a href="<%= help_code_highlighting_path %>" target="_blank">supported languages</a>)</span></th></tr>
27
<tr><th><%= image_tag("jstoolbar/bt_precode.png", { alt: "Вграден код" }) %></th><td>``` ruby<br />3.times do<br />&nbsp;&nbsp;puts 'Hello'<br />end<br />```</td><td>
28
<pre><code class="ruby syntaxhl"><span class="mi">3</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span>
29
  <span class="nb">puts</span> <span class="s1">'Hello'</span>
30
<span class="k">end</span>
31
</code></pre>
32
</td></tr>
33

  
34
<tr><th colspan="3">Lists</th></tr>
35
<tr><th><%= image_tag("jstoolbar/bt_ul.png", { alt: "Unordered list" }) %></th><td>* Item 1<br />&nbsp;&nbsp;* Sub<br />* Item 2</td><td><ul><li>Item 1<ul><li>Sub</li></ul></li><li>Item 2</li></ul></td></tr>
36
<tr><th><%= image_tag("jstoolbar/bt_ol.png", { alt: "Ordered list" }) %></th><td>1. Item 1<br />&nbsp;&nbsp;&nbsp;1. Sub<br />2. Item 2</td><td><ol><li>Item 1<ol><li>Sub</li></ol></li><li>Item 2</li></ol></td></tr>
37

  
38
<tr><th colspan="3">Headings <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "8") %>" target="_blank">more</a>)</span></th></tr>
39
<tr><th><%= image_tag("jstoolbar/bt_h1.png", { alt: "Heading 1" }) %></th><td># Title 1</td><td><h1>Title 1</h1></td></tr>
40
<tr><th><%= image_tag("jstoolbar/bt_h2.png", { alt: "Heading 2" }) %></th><td>## Title 2</td><td><h2>Title 2</h2></td></tr>
41
<tr><th><%= image_tag("jstoolbar/bt_h3.png", { alt: "Heading 3" }) %></th><td>### Title 3</td><td><h3>Title 3</h3></td></tr>
42

  
43
<tr><th colspan="3">Links <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "4") %>" target="_blank">more</a>)</span></th></tr>
44
<tr><th></th><td>http://foo.bar</td><td><a href="#">http://foo.bar</a></td></tr>
45
<tr><th></th><td>[Foo](http://foo.bar)</td><td><a href="#">Foo</a></td></tr>
46

  
47
<tr><th colspan="3">Redmine links <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "3") %>" target="_blank">more</a>)</span></th></tr>
48
<tr><th><%= image_tag("jstoolbar/bt_link.png", { alt: "Link to a Wiki page" }) %></th><td>[[Wiki page]]</td><td><a href="#">Wiki page</a></td></tr>
49
<tr><th></th><td>Issue #12</td><td>Issue <a href="#">#12</a></td></tr>
50
<tr><th></th><td>##12</td><td><a href="#">Bug #12</a>: The issue subject</td></tr>
51
<tr><th></th><td>Revision r43</td><td>Revision <a href="#">r43</a></td></tr>
52
<tr><th></th><td>commit:f30e13e43</td><td><a href="#">f30e13e4</a></td></tr>
53
<tr><th></th><td>source:some/file</td><td><a href="#">source:some/file</a></td></tr>
54

  
55
<tr><th colspan="3">Inline images <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "7") %>" target="_blank">more</a>)</span></th></tr>
56
<tr><th><%= image_tag("jstoolbar/bt_img.png", { alt: "Image" }) %></th><td>![](<em>image_url</em>)</td><td></td></tr>
57
<tr><th></th><td>![](<em>attached_image</em>)</td><td></td></tr>
58

  
59
<tr><th colspan="3">Tables</th></tr>
60
<tr>
61
  <th></th>
62
  <td>| A | B | C |<br />|---|---|---|<br />| A | B | C |<br />| D | E | F |</td>
63
  <td>
64
    <table class="sample">
65
      <tbody>
66
        <th>A</th><th>B</th><th>C</th>
67
        <tr><td>A</td><td>B</td><td>C</td></tr>
68
        <tr><td>D</td><td>E</td><td>F</td></tr>
69
      </tbody>
70
    </table>
71
  </td>
72
</tr>
73

  
74
</table>
75

  
76
<p><a href="<%= help_wiki_syntax_path(:detailed) %>" onclick="window.open('<%= help_wiki_syntax_path(:detailed) %>', '', ''); return false;">More Information</a></p>
77

  
78
</body>
79
</html>
app/views/help/wiki_syntax/markdown/ca/wiki_syntax_detailed_markdown.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title>RedmineWikiFormatting (Markdown)</title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<%= stylesheet_link_tag "wiki_syntax_detailed.css" %>
7
</head>
8

  
9
<body>
10
<h1><a name="1" class="wiki-page"></a>Wiki formatting (Markdown)</h1>
11

  
12
    <ul class='toc'>
13
        <li><a href='#2'>Links</a></li>
14
        <ul>
15
            <li><a href='#3'>Redmine links</a></li>
16
            <li><a href='#4'>External links</a></li>
17
        </ul>
18
        <li><a href='#5'>Text formatting</a></li>
19
        <ul>
20
            <li><a href='#6'>Font style</a></li>
21
            <li><a href='#7'>Inline images</a></li>
22
            <li><a href='#8'>Headings</a></li>
23
            <li><a href='#10'>Blockquotes</a></li>
24
            <li><a href='#11'>Table of content</a></li>
25
            <li><a href='#14'>Horizontal Rule</a></li>
26
        </ul>
27
        <li><a href='#12'>Macros</a></li>
28
        <li><a href='#13'>Code highlighting</a></li>
29
    </ul>
30

  
31
    <h2><a name="2" class="wiki-page"></a>Links</h2>
32

  
33
        <h3><a name="3" class="wiki-page"></a>Redmine links</h3>
34

  
35
        <p>Redmine allows hyperlinking between resources (issues, changesets, wiki pages...) from anywhere wiki formatting is used.</p>
36
        <ul>
37
            <li>Link to an issue: <strong>#124</strong> (displays <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del>, link is striked-through if the issue is closed)</li>
38
            <li>Link to an issue including tracker name and subject: <strong>##124</strong> (displays <a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (New)">Bug #124</a>: bulk edit doesn't change the category or fixed version properties)</li>
39
            <li>Link to an issue note: <strong>#124-6</strong>, or <strong>#124#note-6</strong></li>
40
            <li>Link to an issue note within the same issue: <strong>#note-6</strong></li>
41
        </ul>
42

  
43
        <p>Wiki links:</p>
44

  
45
        <ul>
46
            <li><strong>[[Guide]]</strong> displays a link to the page named 'Guide': <a href="#" class="wiki-page">Guide</a></li>
47
            <li><strong>[[Guide#further-reading]]</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <a href="#" class="wiki-page">Guide</a></li>
48
            <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
49
            <li><strong>[[Guide|User manual]]</strong> displays a link to the same page but with a different text: <a href="#" class="wiki-page">User manual</a></li>
50
        </ul>
51

  
52
        <p>You can also link to pages of an other project wiki:</p>
53

  
54
        <ul>
55
            <li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
56
            <li><strong>[[sandbox:]]</strong> displays a link to the Sandbox wiki main page</li>
57
        </ul>
58

  
59
        <p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="#" class="wiki-page new">Nonexistent page</a>.</p>
60

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

  
63
        <ul>
64
            <li>Documents:
65
                <ul>
66
                    <li><strong>document#17</strong> (link to document with id 17)</li>
67
                    <li><strong>document:Greetings</strong> (link to the document with title "Greetings")</li>
68
                    <li><strong>document:"Some document"</strong> (double quotes can be used when document title contains spaces)</li>
69
                    <li><strong>sandbox:document:"Some document"</strong> (link to a document with title "Some document" in other project "sandbox")</li>
70
                </ul>
71
            </li>
72
        </ul>
73

  
74
        <ul>
75
            <li>Versions:
76
                <ul>
77
                    <li><strong>version#3</strong> (link to version with id 3)</li>
78
                    <li><strong>version:1.0.0</strong> (link to version named "1.0.0")</li>
79
                    <li><strong>version:"1.0 beta 2"</strong></li>
80
                    <li><strong>sandbox:version:1.0.0</strong> (link to version "1.0.0" in the project "sandbox")</li>
81
                </ul>
82
            </li>
83
        </ul>
84

  
85
        <ul>
86
            <li>Attachments:
87
                <ul>
88
                    <li><strong>attachment:file.zip</strong> (link to the attachment of the current object named file.zip)</li>
89
                    <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>
90
                </ul>
91
            </li>
92
        </ul>
93

  
94
        <ul>
95
            <li>Changesets:
96
                <ul>
97
                    <li><strong>r758</strong>                       (link to a changeset)</li>
98
                    <li><strong>commit:c6f4d0fd</strong>            (link to a changeset with a non-numeric hash)</li>
99
                    <li><strong>svn1|r758</strong>                  (link to a changeset of a specific repository, for projects with multiple repositories)</li>
100
                    <li><strong>commit:hg|c6f4d0fd</strong>         (link to a changeset with a non-numeric hash of a specific repository)</li>
101
                    <li><strong>sandbox:r758</strong>               (link to a changeset of another project)</li>
102
                    <li><strong>sandbox:commit:c6f4d0fd</strong>    (link to a changeset with a non-numeric hash of another project)</li>
103
                </ul>
104
            </li>
105
        </ul>
106

  
107
        <ul>
108
             <li>Repository files:
109
                <ul>
110
                    <li><strong>source:some/file</strong>           (link to the file located at /some/file in the project's repository)</li>
111
                    <li><strong>source:some/file@52</strong>        (link to the file's revision 52)</li>
112
                    <li><strong>source:some/file#L120</strong>      (link to line 120 of the file)</li>
113
                    <li><strong>source:some/file@52#L120</strong>   (link to line 120 of the file's revision 52)</li>
114
                    <li><strong>source:"some file@52#L120"</strong> (use double quotes when the URL contains spaces</li>
115
                    <li><strong>export:some/file</strong>           (force the download of the file)</li>
116
                    <li><strong>source:svn1|some/file</strong>      (link to a file of a specific repository, for projects with multiple repositories)</li>
117
                    <li><strong>sandbox:source:some/file</strong>   (link to the file located at /some/file in the repository of the project "sandbox")</li>
118
                    <li><strong>sandbox:export:some/file</strong>   (force the download of the file)</li>
119
                </ul>
120
            </li>
121
        </ul>
122

  
123
        <ul>
124
            <li>Forums:
125
                <ul>
126
                    <li><strong>forum#1</strong> (link to forum with id 1</li>
127
                    <li><strong>forum:Support</strong> (link to forum named Support)</li>
128
                    <li><strong>forum:"Technical Support"</strong> (use double quotes if forum name contains spaces)</li>
129
                </ul>
130
            </li>
131
        </ul>
132

  
133
        <ul>
134
            <li>Forum messages:
135
                <ul>
136
                    <li><strong>message#1218</strong> (link to message with id 1218)</li>
137
                </ul>
138
            </li>
139
        </ul>
140

  
141
        <ul>
142
            <li>Projects:
143
                <ul>
144
                    <li><strong>project#3</strong> (link to project with id 3)</li>
145
                    <li><strong>project:some-project</strong> (link to project with name or slug of "some-project")</li>
146
                    <li><strong>project:"Some Project"</strong> (use double quotes for project name containing spaces)</li>
147
                </ul>
148
             </li>
149
        </ul>
150

  
151
        <ul>
152
            <li>News:
153
                <ul>
154
                    <li><strong>news#2</strong> (link to news item with id 2)</li>
155
                    <li><strong>news:Greetings</strong> (link to news item named "Greetings")</li>
156
                    <li><strong>news:"First Release"</strong> (use double quotes if news item name contains spaces)</li>
157
                </ul>
158
            </li>
159
        </ul>
160

  
161
        <ul>
162
            <li>Users:
163
                <ul>
164
                    <li><strong>user#2</strong> (link to user with id 2)</li>
165
                    <li><strong>user:jsmith</strong> (Link to user with login jsmith)</li>
166
                    <li><strong>@jsmith</strong> (Link to user with login jsmith)</li>
167
                </ul>
168
            </li>
169
        </ul>
170

  
171
        <p>Escaping:</p>
172

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

  
177

  
178
        <h3><a name="4" class="wiki-page"></a>External links</h3>
179

  
180
        <p>URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:</p>
181

  
182
<pre>
183
http://www.redmine.org, someone@foo.bar
184
</pre>
185

  
186
        <p>displays: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
187

  
188
        <p>If you want to display a specific text instead of the URL, you can use the standard markdown syntax:</p>
189

  
190
<pre>
191
[Redmine web site](http://www.redmine.org)
192
</pre>
193

  
194
        <p>displays: <a href="http://www.redmine.org" class="external">Redmine web site</a></p>
195

  
196

  
197
    <h2><a name="5" class="wiki-page"></a>Text formatting</h2>
198

  
199

  
200
    <p>For things such as headlines, bold, tables, lists, Redmine supports Markdown syntax.  See <a class="external" href="http://daringfireball.net/projects/markdown/syntax">http://daringfireball.net/projects/markdown/syntax</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>
201

  
202
        <h3><a name="6" class="wiki-page"></a>Font style</h3>
203

  
204
<pre>
205
* **bold**
206
* *Italic*
207
* ***bold italic***
208
* _underline_
209
* ~~strike-through~~
210
</pre>
211

  
212
        <p>Display:</p>
213

  
214
        <ul>
215
            <li><strong>bold</strong></li>
216
            <li><em>italic</em></li>
217
            <li><em><strong>bold italic</strong></em></li>
218
            <li><u>underline</u></li>
219
            <li><del>strike-through</del></li>
220
        </ul>
221

  
222
        <h3><a name="7" class="wiki-page"></a>Inline images</h3>
223

  
224
        <ul>
225
            <li><strong>![](image_url)</strong> displays an image located at image_url (markdown syntax)</li>
226
            <li>If you have an image attached to your wiki page, it can be displayed inline using its filename: <strong>![](attached_image)</strong></li>
227
            <li>Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v (note that Internet Explorer is not supported).</li>
228
            <li>Image files can be dragged onto the text area in order to be uploaded and embedded.</li>
229
        </ul>
230

  
231
        <h3><a name="8" class="wiki-page"></a>Headings</h3>
232

  
233
<pre>
234
# Heading
235
## Subheading
236
### Subsubheading
237
</pre>
238

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

  
241

  
242
        <h3><a name="10" class="wiki-page"></a>Blockquotes</h3>
243

  
244
        <p>Start the paragraph with <strong>&gt;</strong></p>
245

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

  
251
        <p>Display:</p>
252

  
253
        <blockquote>
254
                <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>
255
        </blockquote>
256

  
257

  
258
        <h3><a name="11" class="wiki-page"></a>Table of content</h3>
259

  
260
<pre>
261
{{toc}} =&gt; left aligned toc
262
{{&gt;toc}} =&gt; right aligned toc
263
</pre>
264

  
265
        <h3><a name="14" class="wiki-page"></a>Horizontal Rule</h3>
266

  
267
<pre>
268
---
269
</pre>
270

  
271
    <h2><a name="12" class="wiki-page"></a>Macros</h2>
272

  
273
    <p>Redmine has the following builtin macros:</p>
274

  
275
    <p>
276
    <dl>
277
      <dt><code>hello_world</code></dt>
278
      <dd><p>Sample macro.</p></dd>
279

  
280
      <dt><code>macro_list</code></dt>
281
      <dd><p>Displays a list of all available macros, including description if available.</p></dd>
282

  
283
      <dt><code>child_pages</code></dt>
284
      <dd><p>Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:</p>
285
      <pre><code>{{child_pages}} -- can be used from a wiki page only
286
{{child_pages(depth=2)}} -- display 2 levels nesting only</code></pre></dd>
287

  
288
      <dt><code>include</code></dt>
289
      <dd><p>Include a wiki page. Example:</p>
290
      <pre><code>{{include(Foo)}}</code></pre>
291
      <p>or to include a page of a specific project wiki:</p>
292
      <pre><code>{{include(projectname:Foo)}}</code></pre></dd>
293

  
294
      <dt><code>collapse</code></dt>
295
      <dd><p>Inserts of collapsed block of text. Example:</p>
296
      <pre><code>{{collapse(View details...)
297
This is a block of text that is collapsed by default.
298
It can be expanded by clicking a link.
299
}}</code></pre></dd>
300

  
301
      <dt><code>thumbnail</code></dt>
302
      <dd><p>Displays a clickable thumbnail of an attached image. Examples:</p>
303
      <pre>{{thumbnail(image.png)}}
304
{{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd>
305

  
306
      <dt><code>issue</code></dt>
307
      <dd><p>Inserts a link to an issue with flexible text. Examples:</p>
308
      <pre>{{issue(123)}}                              -- Issue #123: Enhance macro capabilities
309
{{issue(123, project=true)}}                -- Andromeda - Issue #123:Enhance macro capabilities
310
{{issue(123, tracker=false)}}               -- #123: Enhance macro capabilities
311
{{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123</pre></dd>
312
    </dl>
313
    </p>
314

  
315
    <h2><a name="13" class="wiki-page"></a>Code highlighting</h2>
316

  
317
    <p>Default code highlighting relies on <a href="http://rouge.jneen.net/" class="external">Rouge</a>, a pure Ruby code highlighter. Rouge supports many commonly used languages such as <strong>c</strong>, <strong>cpp</strong> (c++), <strong>csharp</strong> (c#, cs), <strong>css</strong>, <strong>diff</strong> (patch, udiff), <strong>go</strong> (golang), <strong>groovy</strong>, <strong>html</strong>, <strong>java</strong>, <strong>javascript</strong> (js), <strong>kotlin</strong>, <strong>objective_c</strong> (objc), <strong>perl</strong> (pl), <strong>php</strong>, <strong>python</strong> (py), <strong>r</strong>, <strong>ruby</strong> (rb), <strong>sass</strong>, <strong>scala</strong>, <strong>shell</strong> (bash, zsh, ksh, sh), <strong>sql</strong>, <strong>swift</strong>, <strong>xml</strong> and <strong>yaml</strong> (yml) languages - the names inside parentheses are aliases. Please refer to the <a href="<%= help_code_highlighting_path %>" target="_blank">list of languages supported by Redmine code highlighter</a>.</p>
318

  
319
    <p>You can highlight code at any place that supports wiki formatting using this syntax (note that the language name or alias is case-insensitive):</p>
320

  
321
<pre>
322
``` ruby
323
  Place your code here.
324
```
325
</pre>
326

  
327
    <p>Example:</p>
328

  
329
<pre><code class="ruby syntaxhl"><span class="c1"># The Greeter class</span>
330
<span class="k">class</span> <span class="nc">Greeter</span>
331
  <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
332
    <span class="vi">@name</span> <span class="o">=</span> <span class="nb">name</span><span class="p">.</span><span class="nf">capitalize</span>
333
  <span class="k">end</span>
334

  
335
  <span class="k">def</span> <span class="nf">salute</span>
336
    <span class="nb">puts</span> <span class="s2">"Hello </span><span class="si">#{</span><span class="vi">@name</span><span class="si">}</span><span class="s2">!"</span>
337
  <span class="k">end</span>
338
<span class="k">end</span>
339
</code></pre>
340
</body>
341
</html>
app/views/help/wiki_syntax/markdown/ca/wiki_syntax_markdown.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<title>Format de la Wiki</title>
6
<%= stylesheet_link_tag "wiki_syntax.css" %>
7
</head>
8
<body>
9

  
10
<h1>Guia rapida de la Sintaxis de la Wiki (Markdown)</h1>
11

  
12
<table style="width:100%">
13
<tr><th colspan="3">Font Styles <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "5") %>" target="_blank">more</a>)</span></th></tr>
14
<tr><th><%= image_tag("jstoolbar/bt_strong.png", { alt: "Negreta" }) %></th><td style="width:50%;">**Negreta**</td><td style="width:50%;"><strong>Negreta</strong></td></tr>
15
<tr><th><%= image_tag("jstoolbar/bt_em.png", { alt: "Cursiva" }) %></th><td>*Cursiva*</td><td><em>Cursiva</em></td></tr>
16
<tr><th><%= image_tag("jstoolbar/bt_ins.png", { alt: "Underline" }) %></th><td>_Underline_</td><td><ins>Underline</ins></td></tr>
17
<tr><th><%= image_tag("jstoolbar/bt_del.png", { alt: "Eliminat" }) %></th><td>~~Eliminat~~</td><td><del>Eliminat</del></td></tr>
18
<tr><th><%= image_tag("jstoolbar/bt_code.png", { alt: "Codi en línia" }) %></th><td>`Codi en línia`</td><td><code>Codi en línia</code></td></tr>
19
<tr><th><%= image_tag("jstoolbar/bt_pre.png", { alt: "Linies de codi" }) %></th><td>```<br />&nbsp;linies<br />&nbsp;de codi<br />```</td><td>
20
<pre>
21
 linies
22
 de codi
23
</pre>
24
</td></tr>
25

  
26
<tr><th colspan="3">Highlighted code <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "13") %>" target="_blank">more</a> | <a href="<%= help_code_highlighting_path %>" target="_blank">supported languages</a>)</span></th></tr>
27
<tr><th><%= image_tag("jstoolbar/bt_precode.png", { alt: "Highlighted code" }) %></th><td>``` ruby<br />3.times do<br />&nbsp;&nbsp;puts 'Hello'<br />end<br />```</td><td>
28
<pre><code class="ruby syntaxhl"><span class="mi">3</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span>
29
  <span class="nb">puts</span> <span class="s1">'Hello'</span>
30
<span class="k">end</span>
31
</code></pre>
32
</td></tr>
33

  
34
<tr><th colspan="3">Llistes</th></tr>
35
<tr><th><%= image_tag("jstoolbar/bt_ul.png", { alt: "Llista desordenada" }) %></th><td>* Article 1<br />&nbsp;&nbsp;* Sub<br />* Article 2</td><td><ul><li>Article 1<ul><li>Sub</li></ul></li><li>Article 2</li></ul></td></tr>
36
<tr><th><%= image_tag("jstoolbar/bt_ol.png", { alt: "Llista Ordenada" }) %></th><td>1. Article 1<br />&nbsp;&nbsp;&nbsp;1. Sub<br />2. Article 2</td><td><ol><li>Article 1<ol><li>Sub</li></ol></li><li>Article 2</li></ol></td></tr>
37

  
38
<tr><th colspan="3">Capçaleres <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "8") %>" target="_blank">more</a>)</span></th></tr>
39
<tr><th><%= image_tag("jstoolbar/bt_h1.png", { alt: "Encapçament 1" }) %></th><td># Títol 1</td><td><h1>Títol 1</h1></td></tr>
40
<tr><th><%= image_tag("jstoolbar/bt_h2.png", { alt: "Encapçament 2" }) %></th><td>## Títol 2</td><td><h2>Títol 2</h2></td></tr>
41
<tr><th><%= image_tag("jstoolbar/bt_h3.png", { alt: "Encapçament 3" }) %></th><td>### Títol 3</td><td><h3>Títol 3</h3></td></tr>
42

  
43
<tr><th colspan="3">Links <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "4") %>" target="_blank">more</a>)</span></th></tr>
44
<tr><th></th><td>http://foo.bar</td><td><a href="#">http://foo.bar</a></td></tr>
45
<tr><th></th><td>[Foo](http://foo.bar)</td><td><a href="#">Foo</a></td></tr>
46

  
47
<tr><th colspan="3">Redmine links <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "3") %>" target="_blank">more</a>)</span></th></tr>
48
<tr><th><%= image_tag("jstoolbar/bt_link.png", { alt: "Link a la pagina Wiki" }) %></th><td>[[Pagina Wiki]]</td><td><a href="#">Pagina Wiki</a></td></tr>
49
<tr><th></th><td>Assumpte #12</td><td>Assumpte <a href="#">#12</a></td></tr>
50
<tr><th></th><td>##12</td><td><a href="#">Bug #12</a>: The issue subject</td></tr>
51
<tr><th></th><td>Revisió r43</td><td>Revisió <a href="#">r43</a></td></tr>
52
<tr><th></th><td>commit:f30e13e43</td><td><a href="#">f30e13e4</a></td></tr>
53
<tr><th></th><td>source:some/file</td><td><a href="#">source:some/file</a></td></tr>
54

  
55
<tr><th colspan="3">Imatges <span class="more_info">(<a href="<%= help_wiki_syntax_path(:detailed, anchor: "7") %>" target="_blank">more</a>)</span></th></tr>
56
<tr><th><%= image_tag("jstoolbar/bt_img.png", { alt: "Imatge" }) %></th><td>![](<em>imatge_url</em>)</td><td></td></tr>
57
<tr><th></th><td>![](<em>imatge_adjunta</em>)</td><td></td></tr>
58

  
59
<tr><th colspan="3">Taules</th></tr>
60
<tr>
61
  <th></th>
62
  <td>| A | B | C |<br />|---|---|---|<br />| A | B | C |<br />| D | E | F |</td>
63
  <td>
64
    <table class="sample">
65
      <tbody>
66
        <th>A</th><th>B</th><th>C</th>
67
        <tr><td>A</td><td>B</td><td>C</td></tr>
68
        <tr><td>D</td><td>E</td><td>F</td></tr>
69
      </tbody>
70
    </table>
71
  </td>
72
</tr>
73

  
74
</table>
75

  
76
<p><a href="<%= help_wiki_syntax_path(:detailed) %>" onclick="window.open('<%= help_wiki_syntax_path(:detailed) %>', '', ''); return false;">Més informació</a></p>
77

  
78
</body>
79
</html>
app/views/help/wiki_syntax/markdown/cs/wiki_syntax_detailed_markdown.html.erb
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title>Formátování Wiki v Redminu</title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<%= stylesheet_link_tag "wiki_syntax_detailed.css" %>
7
</head>
8

  
9
<body>
10
<h1><a name="1" class="wiki-page"></a>Formátování Wiki (Markdown)</h1>
11

  
12
    <ul class='toc'>
13
        <li><a href='#2'>Odkazy</a></li>
14
        <ul>
15
            <li><a href='#3'>Odkazy Redmine</a></li>
16
            <li><a href='#4'>Externí odkazy</a></li>
17
        </ul>
18
        <li><a href='#5'>Formátování textu</a></li>
19
        <ul>
20
            <li><a href='#6'>Styly písma</a></li>
21
            <li><a href='#7'>Vložené obrázky</a></li>
22
            <li><a href='#8'>Nadpisy</a></li>
23
            <li><a href='#10'>Odstavce</a></li>
24
            <li><a href='#11'>Obsah</a></li>
25
            <li><a href='#14'>Vodorovná čára</a></li>
26
        </ul>
27
        <li><a href='#12'>Macros</a></li>
28
        <li><a href='#13'>Zvýrazňování kódu</a></li>
29
    </ul>
30

  
31
    <h2><a name="2" class="wiki-page"></a>Odkazy</h2>
32

  
33
        <h3><a name="3" class="wiki-page"></a>Odkazy Redmine</h3>
34

  
35
        <p>Redmine umožňuje hypertextové odkazy mezi jednotlivými zdroji (úkoly, revize, wiki stránky...) kdekoli, kde je použito Wiki formátování.</p>
36
        <ul>
37
            <li>Odkaz na úkol: <strong>#124</strong> (zobrazí <del><a href="#" class="issue" title="Hromadná změna nezmění kategorii úkolů (Uzavřeno)">#124</a></del>, odkaz je přeškrtnutý, jestliže je úkol uzavřen)</li>
38
            <li>Odkaz na úkol včetně fronty a předmětu: <strong>##124</strong> (zobrazí <a href="#" class="issue" title="Hromadná změna nezmění kategorii úkolů (Nový)">Bug #124</a>: Hromadná změna nezmění kategorii úkolů)</li>
39
            <li>Odkaz na poznámku k úkolu: <strong>#124-6</strong> nebo <strong>#124#note-6</strong></li>
40
            <li>Odkaz na poznámku k úkolu v tom samém úkole: <strong>#note-6</strong></li>
41
        </ul>
42

  
43
        <p>Odkazy Wiki:</p>
44

  
45
        <ul>
46
            <li><strong>[[Příručka]]</strong> zobrazí odkaz na stránku nazvanou "Příručka": <a href="#" class="wiki-page">Příručka</a>.</li>
47
            <li><strong>[[Příručka#čtěte-více]]</strong> Vás přenese ke kotvě "čtěte-více". Nadpisy mají automaticky přiřazené kotvy, na které se můžete odkazovat: <a href="#" class="wiki-page">Příručka</a>.</li>
48
            <li><strong>[[#čtěte více]]</strong> odkaz na kotvu "čtěte-více" aktuální stránky: <a href="#" class="wiki-page">čtěte více</a></li>
49
            <li><strong>[[Příručka|Uživatelský manuál]]</strong> zobrazí odkaz na tu samou stránku, ale s jiným textem: <a href="#" class="wiki-page">Uživatelský manuál</a>.</li>
50
        </ul>
51

  
52
        <p>Můžete se také odkazovat na Wiki stránky jiného projektu:</p>
53

  
54
        <ul>
55
            <li><strong>[[projekt_test:Nějaká stránka]]</strong> zobrazí odkaz na stránku s názvem "Nějaká stránka" na Wiki projektu projekt_test.</li>
56
            <li><strong>[[projekt_test:]]</strong> zobrazí odkaz na hlavní Wiki stránku projektu projekt_test.</li>
57
        </ul>
58

  
59
        <p>Odkazy na Wiki stránky jsou zobrazeny červeně v případě, že odkazovaná stránka dosud neexistuje, např.: <a href="#" class="wiki-page new">Neexistující stránka</a>.</p>
60

  
61
        <p>Odkazy na další zdroje:</p>
62

  
63
        <ul>
64
            <li>Dokumenty:
65
                <ul>
66
                    <li><strong>document#17</strong> (odkaz na dokument s ID 17)</li>
67
                    <li><strong>document:Úvod</strong> (odkaz na dokument s názvem "Úvod")</li>
68
                    <li><strong>document:"Nějaký dokument"</strong> (Uvozovky se mohou použít v případě, že název obsahuje mezery.)</li>
69
                    <li><strong>projekt_test:document:"Nějaký dokument"</strong> (odkaz na dokument s názvem "Nějaký dokument" v jiném projektu "projekt_test")</li>
70
                </ul>
71
            </li>
72
        </ul>
73

  
74
        <ul>
75
            <li>Verze:
76
                <ul>
77
                    <li><strong>version#3</strong> (odkaz na verzi s ID 3)</li>
78
                    <li><strong>version:1.0.0</strong> odkaz na verzi s názvem "1.0.0")</li>
79
                    <li><strong>version:"1.0 beta 2"</strong></li>
80
                    <li><strong>projekt_test:version:1.0.0</strong> (odkaz na verzi "1.0.0" jiného projektu "projekt_test")</li>
81
                </ul>
82
            </li>
83
        </ul>
84

  
85
        <ul>
86
            <li>Přílohy:
87
                <ul>
88
                    <li><strong>attachment:soubor.zip</strong> (odkaz na přílohu aktuálního objektu s názvem soubor.zip)</li>
89
                    <li>Aktuálně mohou být odkazovány pouze přílohy aktuálního objektu (u úkolu mohou být odkazy pouze na přílohy danného úkolu).</li>
90
                </ul>
91
            </li>
92
        </ul>
93

  
94
        <ul>
95
            <li>Revize:
96
                <ul>
97
                    <li><strong>r758</strong>                       (odkaz na revizi)</li>
98
                    <li><strong>commit:c6f4d0fd</strong>            (odkaz na revizi s nečíselným označním revize)</li>
99
                    <li><strong>svn1|r758</strong>                  (odkaz na revizi určitého repozitáře, pro projekty s více repozitáři)</li>
100
                    <li><strong>commit:hg|c6f4d0fd</strong>         (odkaz na revizi  s nečíselným označním revize určitého repozitáře, pro projekty s více repozitáři)</li>
101
                    <li><strong>projekt_test:r758</strong>               (odkaz na revizi jiného projektu)</li>
102
                    <li><strong>projekt_test:commit:c6f4d0fd</strong>    (odkaz na revizi  s nečíselným označním revize jiného projektu)</li>
103
                </ul>
104
            </li>
105
        </ul>
106

  
107
        <ul>
108
             <li>Soubory repositáře:
109
                <ul>
110
                    <li><strong>source:some/file</strong>           (odkaz na soubor umístěný v /some/file respozitáře projektu)</li>
111
                    <li><strong>source:some/file@52</strong>        (odkaz na revizi souboru č. 52)</li>
112
                    <li><strong>source:some/file#L120</strong>      (odkaz na 120. řádek souboru)</li>
113
                    <li><strong>source:some/file@52#L120</strong>   (odkaz na 120. řádek revize souboru č. 52)</li>
114
                    <li><strong>source:"some file@52#L120"</strong> (použijte uvozovky, když URL obsahuje mezery)</li>
115
                    <li><strong>export:some/file</strong>           (vynutit stažení souboru)</li>
116
                    <li><strong>source:svn1|some/file</strong>      (odkaz na soubor určitého repozitáře, pro projekty s více repositáři)</li>
117
                    <li><strong>projekt_test:source:some/file</strong>   (odkaz na soubor umístěný v /some/file repositáře projektu "projekt_test")</li>
118
                    <li><strong>projekt_test:export:some/file</strong>   (vynutit stažení souboru umístěného v /some/file repositáře projektu "projekt_test")</li>
119
                </ul>
120
             </li>
121
        </ul>
122

  
123
        <ul>
124
            <li>Diskuzní fóra:
125
                <ul>
126
                    <li><strong>forum#1</strong> (odkaz na fórum s id 1</li>
127
                    <li><strong>forum:Support</strong> (odkaz na fórum pojmenované Support)</li>
128
                    <li><strong>forum:"Technical Support"</strong> (Použij dvojté uvozovkym jestliže název fóra obsahuje mezery.)</li>
129
                </ul>
130
            </li>
131
        </ul>
132

  
133
        <ul>
134
            <li>Příspěvky diskuzního fóra:
135
                <ul>
136
                    <li><strong>message#1218</strong> (odkaz na příspěvek s ID 1218)</li>
137
                </ul>
138
            </li>
139
        </ul>
140

  
141
        <ul>
142
            <li>Projekty:
143
                <ul>
144
                    <li><strong>project#3</strong> (odkaz na projekt s ID 3)</li>
145
                    <li><strong>project:projekt_test</strong> (odkaz na projekt pojmenovaný "projekt_test")</li>
146
                    <li><strong>project:"projekt test"</strong> (odkaz na projekt pojmenovaný "projekt test")</li>
147
                </ul>
148
            </li>
149
        </ul>
150

  
151
        <ul>
152
            <li>Novinky:
153
                <ul>
154
                    <li><strong>news#2</strong> (odkaz na novinku id 2)</li>
155
                    <li><strong>news:Greetings</strong> (odkaz na novinku "Greetings")</li>
156
                    <li><strong>news:"First Release"</strong> (použij dvojté uvozovky, jestliže název novinky obsahuje mezery)</li>
157
                </ul>
158
            </li>
159
        </ul>
160

  
161
        <ul>
162
            <li>Uživatelé:
163
                <ul>
164
                    <li><strong>user#2</strong> (odkaz na uživatele s id 2)</li>
165
                    <li><strong>user:jsmith</strong> (odkaz na uživatele s loginem jsmith)</li>
166
                    <li><strong>@jsmith</strong> (odkaz na uživatele s loginem jsmith)</li>
167
                </ul>
168
            </li>
169
        </ul>
170

  
171
        <p>Escape sekvence:</p>
172

  
173
        <ul>
174
            <li>Zabránit parsování Redmine odkazů lze vložením vykřičníku před odkaz: !</li>
175
        </ul>
176

  
177
        <h3><a name="4" class="wiki-page"></a>Externí odkazy</h3>
178

  
179
        <p>URL (začínající: www, http, https, ftp, ftps, sftp a sftps) a e-mailové adresy jsou automaticky převedeny na klikací odkazy:</p>
180

  
181
<pre>
182
http://www.redmine.org, someone@foo.bar
183
</pre>
184

  
185
        <p>zobrazí: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
186

  
187
        <p>Jestliže chcete zobrazit určitý text místo URL, můžete použít standardní syntaxi Textile:</p>
188

  
189
<pre>
190
"Webová stránka Redmine":http://www.redmine.org
191
</pre>
192

  
193
        <p>zobrazí: <a href="http://www.redmine.org" class="external">Webová stránka Redmine</a></p>
194

  
195

  
196
    <h2><a name="5" class="wiki-page"></a>Formátování textu</h2>
197

  
198

  
199
    <p>Pro nadpisy, tučný text, tabulky a seznamy, Redmine podporuje syntaxi Markdown. Podívejte se na <a class="external" href="http://daringfireball.net/projects/markdown/syntax">http://daringfireball.net/projects/markdown/syntax</a> pro informace o využití těchto vlastností. Několik příkladů je uvedeno níže, ale Markdown toho dokáže mnohem víc.</p>
200

  
201
        <h3><a name="6" class="wiki-page"></a>Styly písma</h3>
202

  
203
<pre>
204
* **tučný**
205
* *kurzíva*
206
* ***tučná kurzíva***
207
* ~~přeškrtnutý~~
208
</pre>
209

  
210
        <p>Zobrazí:</p>
211

  
212
        <ul>
213
            <li><strong>tučný</strong></li>
214
            <li><em>kurzíva</em></li>
215
            <li><em><strong>tučná kurzíva</strong></em></li>
216
            <li><del>přeškrtnutý</del></li>
217
        </ul>
218

  
219
        <h3><a name="7" class="wiki-page"></a>Vnořené obrázky</h3>
220

  
221
        <ul>
222
            <li><strong>![](image_url)</strong> zobrazí obrázek z odkazu (syntaxe Markdown)</li>
223
            <li>Jestliže máte obrázek přiložený k Wiki stránce, může být zobrazen jako vnořený obrázek pomocí jeho jména: <strong>![](attached_image)</strong></li>
224
            <li>Obrázky ze schránky mohou být vloženy přímo pomocí Ctrl-v/Command-v.</li>
225
            <li>Soubory s obrázky mohou být přímo přetaženy do textového pole. Budou nahrány a vloženy.</li>
226
        </ul>
227

  
228
        <h3><a name="8" class="wiki-page"></a>Nadpisy</h3>
229

  
230
<pre>
231
# Nadpis 1. úrovně
232
## Nadpis 2. úrovně
233
### Nadpis 3. úrovně
234
</pre>
235

  
236
<p>Redmine přiřadí kotvu ke každému nadpisu, takže se na ně lze odkazovat pomocí "#Nadpis", "#Podnadpis" atd.</p>
237

  
238

  
239
        <h3><a name="10" class="wiki-page"></a>Odstavce</h3>
240

  
241
        <p>Začněte odstavec s <strong>&gt;</strong></p>
242

  
243
<pre>
244
&gt; Rails je framework pro vývoj webových aplikací podle modelu Model-View-Control.
245
Vše, co je potřeba, je databázový a webový server.
246
</pre>
247

  
248
        <p>Zobrazí:</p>
... This diff was truncated because it exceeds the maximum size that can be displayed.
    (1-1/1)