sinatra-s3 0.98 → 0.99
Sign up to get free protection for your applications and to get access to all the features.
- data/README +36 -18
- data/bin/sinatra-s3 +47 -15
- data/examples/wiki.rb +13 -13
- data/lib/sinatra-s3/admin.rb +1 -1
- data/lib/sinatra-s3/base.rb +1 -5
- data/lib/sinatra-s3/models/bit.rb +2 -2
- data/lib/sinatra-s3/s3.rb +11 -4
- data/public/js/wiki.js +35 -0
- data/s3.yml.example +6 -3
- metadata +63 -67
- data/examples/README +0 -9
- data/examples/wikicloth/MIT-LICENSE +0 -20
- data/examples/wikicloth/README +0 -81
- data/examples/wikicloth/Rakefile +0 -23
- data/examples/wikicloth/init.rb +0 -1
- data/examples/wikicloth/install.rb +0 -0
- data/examples/wikicloth/lib/core_ext.rb +0 -43
- data/examples/wikicloth/lib/wiki_buffer.rb +0 -279
- data/examples/wikicloth/lib/wiki_buffer/html_element.rb +0 -237
- data/examples/wikicloth/lib/wiki_buffer/link.rb +0 -70
- data/examples/wikicloth/lib/wiki_buffer/table.rb +0 -159
- data/examples/wikicloth/lib/wiki_buffer/var.rb +0 -77
- data/examples/wikicloth/lib/wiki_cloth.rb +0 -61
- data/examples/wikicloth/lib/wiki_link_handler.rb +0 -138
- data/examples/wikicloth/lib/wikicloth.rb +0 -5
- data/examples/wikicloth/run_tests.rb +0 -48
- data/examples/wikicloth/sample_documents/air_force_one.wiki +0 -170
- data/examples/wikicloth/sample_documents/cheatsheet.wiki +0 -205
- data/examples/wikicloth/sample_documents/default.css +0 -34
- data/examples/wikicloth/sample_documents/elements.wiki +0 -7
- data/examples/wikicloth/sample_documents/george_washington.wiki +0 -526
- data/examples/wikicloth/sample_documents/images.wiki +0 -15
- data/examples/wikicloth/sample_documents/lists.wiki +0 -421
- data/examples/wikicloth/sample_documents/pipe_trick.wiki +0 -68
- data/examples/wikicloth/sample_documents/random.wiki +0 -55
- data/examples/wikicloth/sample_documents/tv.wiki +0 -312
- data/examples/wikicloth/sample_documents/wiki.png +0 -0
- data/examples/wikicloth/sample_documents/wiki_tables.wiki +0 -410
- data/examples/wikicloth/tasks/wikicloth_tasks.rake +0 -0
- data/examples/wikicloth/test/test_helper.rb +0 -3
- data/examples/wikicloth/test/wiki_cloth_test.rb +0 -8
- data/examples/wikicloth/uninstall.rb +0 -0
- data/examples/wikicloth/wikicloth-0.1.3.gem +0 -0
- data/examples/wikicloth/wikicloth.gemspec +0 -69
- data/public/test.html +0 -8
@@ -1,15 +0,0 @@
|
|
1
|
-
[[Image:wiki.png]]
|
2
|
-
|
3
|
-
[[Image:wiki.png|Wikipedia, The Free Encyclopedia.]]
|
4
|
-
|
5
|
-
[[Image:wiki.png|frame|Wikipedia Encyclopedia]]
|
6
|
-
|
7
|
-
[[Image:wiki.png|thumb|Wikipedia Encyclopedia]]
|
8
|
-
|
9
|
-
[[Image:wiki.png|right|Wikipedia Encyclopedia]]
|
10
|
-
|
11
|
-
[[Image:wiki.png|30 px]]
|
12
|
-
|
13
|
-
[[:Image:wiki.png]]
|
14
|
-
|
15
|
-
|
@@ -1,421 +0,0 @@
|
|
1
|
-
This page deals with creating lists in Mediawiki.
|
2
|
-
|
3
|
-
== List basics ==
|
4
|
-
|
5
|
-
[[MediaWiki]] offers three types of lists. '''Ordered lists''', '''unordered lists''', and '''definition lists'''. In the following sections, ordered lists are used for examples. Unordered lists would give corresponding results.
|
6
|
-
|
7
|
-
{|border="1" width="79%"
|
8
|
-
!wikitext!!rendering
|
9
|
-
|-
|
10
|
-
|
|
11
|
-
* Lists are easy to do:
|
12
|
-
** start every line
|
13
|
-
* with a star
|
14
|
-
** more stars mean
|
15
|
-
*** deeper levels
|
16
|
-
||
|
17
|
-
* Lists are easy to do:
|
18
|
-
** start every line
|
19
|
-
* with a star
|
20
|
-
** more stars mean
|
21
|
-
*** deeper levels
|
22
|
-
|-
|
23
|
-
|
|
24
|
-
*A newline
|
25
|
-
*in a list
|
26
|
-
marks the end of the list.
|
27
|
-
Of course
|
28
|
-
*you can
|
29
|
-
*start again.
|
30
|
-
|
|
31
|
-
*A newline
|
32
|
-
*in a list
|
33
|
-
marks the end of the list.
|
34
|
-
Of course
|
35
|
-
*you can
|
36
|
-
*start again.
|
37
|
-
|-
|
38
|
-
|
|
39
|
-
# Numbered lists are good
|
40
|
-
## very organized
|
41
|
-
## easy to follow
|
42
|
-
|
|
43
|
-
# Numbered lists are good
|
44
|
-
## very organized
|
45
|
-
## easy to follow
|
46
|
-
|-
|
47
|
-
|
|
48
|
-
* You can also
|
49
|
-
**break lines
|
50
|
-
**like this
|
51
|
-
|
|
52
|
-
* You can also
|
53
|
-
**break lines
|
54
|
-
**like this
|
55
|
-
|-
|
56
|
-
|
|
57
|
-
; Definition lists
|
58
|
-
; item : definition
|
59
|
-
; semicolon plus term
|
60
|
-
: colon plus definition
|
61
|
-
|
|
62
|
-
; Definition lists
|
63
|
-
; item : definition
|
64
|
-
; semicolon plus term
|
65
|
-
: colon plus definition
|
66
|
-
|-
|
67
|
-
|
|
68
|
-
* Or create mixed lists
|
69
|
-
*# and nest them
|
70
|
-
*#* like this
|
71
|
-
*#*; definitions
|
72
|
-
*#*: work:
|
73
|
-
*#*; apple
|
74
|
-
*#*; banana
|
75
|
-
*#*: fruits
|
76
|
-
|
|
77
|
-
* Or create mixed lists
|
78
|
-
*# and nest them
|
79
|
-
*#* like this
|
80
|
-
*#*; definitions
|
81
|
-
*#*: work:
|
82
|
-
*#*; apple
|
83
|
-
*#*; banana
|
84
|
-
*#*: fruits
|
85
|
-
|}{{-}}
|
86
|
-
|
87
|
-
== Paragraphs in lists ==
|
88
|
-
|
89
|
-
For simplicity, list items in wiki markup cannot be longer than a paragraph. A following blank line will end the list and reset the counter on ordered lists. Separating unordered list items usually has no noticeable effects.
|
90
|
-
|
91
|
-
Paragraphs can be forced in lists by using HTML tags. Two line break symbols, <code><nowiki><br><br></nowiki></code>, will create the desired effect. So will enclosing all but the first paragraph with <code><nowiki><p>...</p></nowiki></code>
|
92
|
-
|
93
|
-
For a list with items of more than one paragraph long, adding a blank line between items may be necessary to avoid confusion.
|
94
|
-
|
95
|
-
*lists
|
96
|
-
**ordered lists
|
97
|
-
**unordered lists
|
98
|
-
***definition lists
|
99
|
-
|
100
|
-
==Continuing a list item after a sub-item==
|
101
|
-
|
102
|
-
In HTML, a list item may contain several sublists, not necessarily adjacent; thus there may be parts of the list item not only before the first sublist, but also between sublists, and after the last one; however, in wiki-syntax, sublists follow the same rules as sections of a page: the only possible part of the list item not in sublists is before the first sublist.
|
103
|
-
|
104
|
-
In the case of an unnumbered first-level list in wikitext code this limitation can be overcome by splitting the list into multiple lists; indented text between the partial lists may visually serve as part of a list item after a sublist; however, this may give, depending on CSS, a blank line before and after each list, in which case, for uniformity, every first-level list item could be made a separate list.
|
105
|
-
|
106
|
-
Numbered lists illustrate that what should look like one list may, for the software, consist of multiple lists; unnumbered lists give a corresponding result, except that the problem of restarting with 1 is not applicable.
|
107
|
-
|
108
|
-
{| style="border:1px;border-spacing:1px;background-color:black;" cellpadding="5"
|
109
|
-
|- style="background-color:white;"
|
110
|
-
|
|
111
|
-
<nowiki>
|
112
|
-
<ol>
|
113
|
-
<li>list item A1
|
114
|
-
<ol>
|
115
|
-
<li>list item B1</li>
|
116
|
-
<li>list item B2</li>
|
117
|
-
</ol>continuing list item A1
|
118
|
-
</li>
|
119
|
-
<li>list item A2</li>
|
120
|
-
</ol></nowiki>
|
121
|
-
| <ol>
|
122
|
-
<li>list item A1
|
123
|
-
<ol>
|
124
|
-
<li>list item B1</li>
|
125
|
-
<li>list item B2</li>
|
126
|
-
</ol>continuing list item A1
|
127
|
-
</li>
|
128
|
-
<li>list item A2</li>
|
129
|
-
</ol>
|
130
|
-
|- style="background-color:#E0E0E0;font-weight:bold;text-align:center;"
|
131
|
-
| colspan="2" | vs.
|
132
|
-
|- style="background-color:white;"
|
133
|
-
|
|
134
|
-
#list item A1
|
135
|
-
##list item B1
|
136
|
-
##list item B2
|
137
|
-
#:continuing list item A1
|
138
|
-
#list item A2
|
139
|
-
|
|
140
|
-
#list item A1
|
141
|
-
##list item B1
|
142
|
-
##list item B2
|
143
|
-
#:continuing list item A1
|
144
|
-
#list item A2
|
145
|
-
|}
|
146
|
-
|
147
|
-
One level deeper, with a sublist item continuing after a sub-sublist, one gets even more blank lines; however, the continuation of the first-level list is not affected:
|
148
|
-
<pre>
|
149
|
-
#list item A1
|
150
|
-
##list item B1
|
151
|
-
###list item C1
|
152
|
-
##:continuing list item B1
|
153
|
-
##list item B2
|
154
|
-
#list item A2
|
155
|
-
</pre>
|
156
|
-
gives
|
157
|
-
#list item A1
|
158
|
-
##list item B1
|
159
|
-
###list item C1
|
160
|
-
##:continuing list item B1
|
161
|
-
##list item B2
|
162
|
-
#list item A2
|
163
|
-
|
164
|
-
See also {{tim|List demo}} and [[Help:Section#Subdivisions in general|subdivisions]].
|
165
|
-
|
166
|
-
== Changing the list type ==
|
167
|
-
|
168
|
-
The list type (which type of marker appears before the list item) can be changed in CSS by setting the [http://www.w3.org/TR/REC-CSS2/generate.html#lists list-style-type] property:
|
169
|
-
|
170
|
-
{|border="1" width="79%"
|
171
|
-
!wikitext!!rendering
|
172
|
-
|-
|
173
|
-
|
|
174
|
-
<nowiki>
|
175
|
-
<ol style="list-style-type:lower-roman">
|
176
|
-
<li>About the author</li>
|
177
|
-
<li>Foreword to the first edition</li>
|
178
|
-
<li>Foreword to the second edition</li>
|
179
|
-
</ol></nowiki>
|
180
|
-
|<ol style="list-style-type:lower-roman">
|
181
|
-
<li>About the author</li>
|
182
|
-
<li>Foreword to the first edition</li>
|
183
|
-
<li>Foreword to the second edition</li>
|
184
|
-
</ol>
|
185
|
-
|-
|
186
|
-
|}
|
187
|
-
|
188
|
-
==Extra indentation of lists==
|
189
|
-
In a numbered list in a large font, some browsers do not show more than two digits, unless extra indentation is applied (if there are multiple columns: for each column). This can be done with CSS:
|
190
|
-
ol { margin-left: 2cm}
|
191
|
-
or alternatively, like below.
|
192
|
-
|
193
|
-
{|border=1
|
194
|
-
!wikitext!!rendering
|
195
|
-
! style="width: 40%" | comments
|
196
|
-
|-
|
197
|
-
|
|
198
|
-
<nowiki>
|
199
|
-
:#abc
|
200
|
-
:#def
|
201
|
-
:#ghi
|
202
|
-
</nowiki>
|
203
|
-
|
|
204
|
-
:#abc
|
205
|
-
:#def
|
206
|
-
:#ghi
|
207
|
-
| A list of one or more lines starting with a colon creates a [http://www.w3.org/TR/html4/struct/lists.html#edef-DL definition list] without definition terms, and with the items as definition descriptions, hence indented. However, if the colons are in front of the codes "*" or "#" of an unordered or ordered list, the list is treated as one definition description, so the whole list is indented.
|
208
|
-
|-
|
209
|
-
|
|
210
|
-
<nowiki>
|
211
|
-
<ul>
|
212
|
-
<ol>
|
213
|
-
<li>abc</li>
|
214
|
-
<li>def</li>
|
215
|
-
<li>ghi</li>
|
216
|
-
</ol>
|
217
|
-
</ul>
|
218
|
-
</nowiki>
|
219
|
-
|
|
220
|
-
<ul>
|
221
|
-
<ol>
|
222
|
-
<li>abc</li>
|
223
|
-
<li>def</li>
|
224
|
-
<li>ghi</li>
|
225
|
-
</ol>
|
226
|
-
</ul>
|
227
|
-
| MediaWiki translates an unordered list (ul) without any list items (li) into a div with a <code>style="margin-left: 2em"</code>, causing indentation of the contents. This is '''the most versatile method''', as it allows starting with a number other than 1, see below.
|
228
|
-
|
229
|
-
|-
|
230
|
-
|
|
231
|
-
<nowiki>
|
232
|
-
<ul>
|
233
|
-
#abc
|
234
|
-
#def
|
235
|
-
#ghi
|
236
|
-
</ul>
|
237
|
-
</nowiki>
|
238
|
-
|
|
239
|
-
<ul>
|
240
|
-
#abc
|
241
|
-
#def
|
242
|
-
#ghi
|
243
|
-
</ul>
|
244
|
-
|Like above, with the content of the "unordered list without any list items", which itself is an ordered list, expressed with # codes. The HTML produced, and hence the rendering, is the same. This is the '''recommended''' method when not starting with a number other than 1.
|
245
|
-
|
246
|
-
|}
|
247
|
-
|
248
|
-
To demonstrate that all three methods show all digits of 3-digit numbers, see [[m:Help:List demo|List demo]].
|
249
|
-
|
250
|
-
==Specifying a starting value==
|
251
|
-
Specifying a starting value is only possible with HTML syntax.
|
252
|
-
(W3C has deprecated the <code>start</code> and <code>value</code> attributes as used below in HTML 4.01 and XHTML 1.0. But as of 2007, no popular web browsers implement CSS counters, which were to replace these attributes. Wikimedia projects use XHTML Transitional, which contains the deprecated attributes.)
|
253
|
-
|
254
|
-
<pre>
|
255
|
-
<ol start="9">
|
256
|
-
<li>Amsterdam</li>
|
257
|
-
<li>Rotterdam</li>
|
258
|
-
<li>The Hague</li>
|
259
|
-
</ol>
|
260
|
-
</pre>
|
261
|
-
gives
|
262
|
-
<ol start="9">
|
263
|
-
<li>Amsterdam</li>
|
264
|
-
<li>Rotterdam</li>
|
265
|
-
<li>The Hague</li>
|
266
|
-
</ol>
|
267
|
-
|
268
|
-
Or:
|
269
|
-
<pre>
|
270
|
-
<ol>
|
271
|
-
<li value="9">Amsterdam</li>
|
272
|
-
<li value="8">Rotterdam</li>
|
273
|
-
<li value="7">The Hague</li>
|
274
|
-
</ol>
|
275
|
-
</pre>
|
276
|
-
gives
|
277
|
-
<ol>
|
278
|
-
<li value="9">Amsterdam</li>
|
279
|
-
<li value="8">Rotterdam</li>
|
280
|
-
<li value="7">The Hague</li>
|
281
|
-
</ol>
|
282
|
-
|
283
|
-
==Comparison with a table==
|
284
|
-
Apart from providing automatic numbering, the numbered list also aligns the contents of the items, comparable with using table syntax:
|
285
|
-
<pre>
|
286
|
-
{|
|
287
|
-
|-
|
288
|
-
| align=right | 9.||Amsterdam
|
289
|
-
|-
|
290
|
-
| align=right | 10.||Rotterdam
|
291
|
-
|-
|
292
|
-
| align=right | 11.||The Hague
|
293
|
-
|}
|
294
|
-
</pre>
|
295
|
-
gives
|
296
|
-
{|
|
297
|
-
|-
|
298
|
-
| align=right | 9.||Amsterdam
|
299
|
-
|-
|
300
|
-
| align=right | 10.||Rotterdam
|
301
|
-
|-
|
302
|
-
| align=right | 11.||The Hague
|
303
|
-
|}
|
304
|
-
|
305
|
-
This non-automatic numbering has the advantage that if a text refers to the numbers, insertion or deletion of an item does not disturb the correspondence.
|
306
|
-
|
307
|
-
==Multi-column bulleted list==
|
308
|
-
<pre>
|
309
|
-
{|
|
310
|
-
|
|
311
|
-
*1
|
312
|
-
*2
|
313
|
-
|
|
314
|
-
*3
|
315
|
-
*4
|
316
|
-
|}
|
317
|
-
</pre>
|
318
|
-
gives:
|
319
|
-
{|
|
320
|
-
|
|
321
|
-
*1
|
322
|
-
*2
|
323
|
-
|
|
324
|
-
*3
|
325
|
-
*4
|
326
|
-
|}
|
327
|
-
|
328
|
-
==Multi-column numbered list==
|
329
|
-
Specifying a starting value is useful for a numbered list with multiple columns, to avoid restarting from one in each column. As mentioned above, this is only possible with HTML-syntax (for the first column either wiki-syntax or HTML-syntax can be used).
|
330
|
-
|
331
|
-
In combination with the extra indentation explained in the previous section:
|
332
|
-
<pre>
|
333
|
-
{| valign="top"
|
334
|
-
|-
|
335
|
-
|<ul><ol start="125"><li>a<li>bb<li>ccc</ol></ul>
|
336
|
-
|<ul><ol start="128"><li>ddd<li>ee<li>f</ol></ul>
|
337
|
-
|}
|
338
|
-
</pre>
|
339
|
-
|
340
|
-
gives
|
341
|
-
|
342
|
-
{| valign="top"
|
343
|
-
|-
|
344
|
-
|<ul><ol start="125"><li>a<li>bb<li>ccc</ol></ul>
|
345
|
-
|<ul><ol start="128"><li>ddd<li>ee<li>f</ol></ul>
|
346
|
-
|}
|
347
|
-
|
348
|
-
Using {{tim|multi-column numbered list}} the computation of the starting values can be automated, and only the first starting value and the number of items in each column except the last has to be specified. Adding an item to, or removing an item from a column requires adjusting only one number, the number of items in that column, instead of changing the starting numbers for all subsequent columns.
|
349
|
-
|
350
|
-
<pre>{{Multi-column numbered list|125|a<li>bb<li>ccc|3|<li>ddd<li>ee<li>f}}</pre>
|
351
|
-
|
352
|
-
gives
|
353
|
-
|
354
|
-
{{Multi-column numbered list|125|a<li>bb<li>ccc|3|<li>ddd<li>ee<li>f}}
|
355
|
-
|
356
|
-
<pre>{{Multi-column numbered list|lst=lower-alpha|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}</pre>
|
357
|
-
|
358
|
-
gives
|
359
|
-
|
360
|
-
{{Multi-column numbered list|lst=lower-alpha|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}
|
361
|
-
|
362
|
-
<pre>{{Multi-column numbered list|lst=lower-roman|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}</pre>
|
363
|
-
|
364
|
-
gives
|
365
|
-
|
366
|
-
{{Multi-column numbered list|lst=lower-roman|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}
|
367
|
-
|
368
|
-
<pre>{{Multi-column numbered list|lst=disc|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}</pre>
|
369
|
-
|
370
|
-
gives
|
371
|
-
|
372
|
-
{{Multi-column numbered list|lst=disc|125|a<li>bb<li>ccc|3|<li>ddd<li>ee|2|<li>f}}
|
373
|
-
|
374
|
-
Note that the starting values of each column (125, +3, +2) have no effect when the disc list type is used.
|
375
|
-
|
376
|
-
==Streamlined style or horizontal style==
|
377
|
-
It is also possible to present short lists using very basic formatting, such as:
|
378
|
-
|
379
|
-
<nowiki>''Title of list:''</nowiki> example 1, example 2, example 3
|
380
|
-
|
381
|
-
''Title of list:'' example 1, example 2, example 3
|
382
|
-
|
383
|
-
This style requires less space on the page, and is preferred if there are only a few entries in the list, it can be read easily, and a direct edit point is not required. The list items should start with a lowercase letter unless they are proper nouns.
|
384
|
-
|
385
|
-
==Tables==
|
386
|
-
A one-column table is very similar to a list, but it allows sorting. If the wikitext itself is already sorted with the same sortkey, this advantage does not apply.
|
387
|
-
A multiple-column table allows sorting on any column.
|
388
|
-
|
389
|
-
See also .
|
390
|
-
|
391
|
-
==Changing unordered lists to ordered ones==
|
392
|
-
With the CSS
|
393
|
-
ul { list-style: decimal }
|
394
|
-
unordered lists are changed to ordered ones. This applies (as far as the CSS selector does not restrict this) to all ul-lists in the HTML source code:
|
395
|
-
*those produced with *
|
396
|
-
*those with <nowiki><ul></nowiki> in the wikitext
|
397
|
-
*those produced by the system
|
398
|
-
|
399
|
-
Since each special page, like other pages, has a class based on the pagename, one can separately specify for each type whether the lists should be ordered, see [[Help:User contributions#User styles]] and [[Help:What links here#User styles]].
|
400
|
-
|
401
|
-
However, it does not seem possible to make all page history lists ordered (unless one makes ''all'' lists ordered), because the class name is based on the page for which the history is viewed.
|
402
|
-
|
403
|
-
==See also==
|
404
|
-
*[[mw:Extension:Sort2]]: creates a list with list code only at the start and end, not per item; allows easy change of list type; sorts list
|
405
|
-
|
406
|
-
==Wikipedia-specific help==
|
407
|
-
|
408
|
-
* [[Wikipedia:Lists]] - For suggested styles of lists.''
|
409
|
-
* {{tn|·}} and {{tn|•}} - Dots and bullets for horizontal link lists, such as in [[Template:Navbox|navboxes]], which look like lists, but do not use HTML list mark-up.
|
410
|
-
**{{tl|flatlist}} - for a more semantically-correct and accessible way of marking up such lists.
|
411
|
-
* [[Wikipedia:Line break handling]] - Covers among other things how to properly handle the line wrapping in horizontal link lists.
|
412
|
-
|
413
|
-
[[Category:Wikipedia help]]
|
414
|
-
|
415
|
-
[[ar:مساعدة:قوائم]]
|
416
|
-
[[de:Hilfe:Listen]]
|
417
|
-
[[dsb:Pomoc:Lisćina]]
|
418
|
-
[[es:Ayuda:Listas]]
|
419
|
-
[[hsb:Pomoc:Lisćina]]
|
420
|
-
[[it:Aiuto:Liste]]
|
421
|
-
|
@@ -1,68 +0,0 @@
|
|
1
|
-
The '''pipe trick''' is a way (or really several ways) to create links without having to type a lot of extra text. The advantage is that you are less likely to make a mistake when you type less. It's also easier for others to edit it. To create the [[pipe character]] ("|") press (SHIFT + BACKSLASH ["\"]) on English-layout and some other keyboards.
|
2
|
-
When you place a [[Vertical bar|pipe character]] ("'''|'''") after an [[Wikipedia:What is an article?|article]] title which ends with a [[Bracket#Parentheses ( )|parenthesized]] term or contains a [[comma (punctuation)|comma]] or [[Colon (punctuation)|colon]], the [[wiki software]] transforms what you entered. The non-parenthesized part of the article title is used as the visible part of the link. This does not work in edit summaries, and in certain other cases (listed below).
|
3
|
-
|
4
|
-
==Examples==
|
5
|
-
This may be hard to follow, so please see the examples:
|
6
|
-
|
7
|
-
{| class="wikitable"
|
8
|
-
|-
|
9
|
-
!| Type this
|
10
|
-
!| Generates this when you "Save page"
|
11
|
-
!| Appears as
|
12
|
-
|-
|
13
|
-
! colspan="3" style="text-align: left;" | Article titles
|
14
|
-
|-
|
15
|
-
|| <code><nowiki>[[g (factor)|]]</nowiki></code> || <code><nowiki>[[g (factor)|g]]</nowiki></code> || [[g (factor)|g]]
|
16
|
-
|-
|
17
|
-
|| <code><nowiki>[[Boston, Massachusetts|]]</nowiki></code> || <code><nowiki>[[Boston, Massachusetts|Boston]]</nowiki></code> || [[Boston, Massachusetts|Boston]]
|
18
|
-
|-
|
19
|
-
|| <code><nowiki>[[The Lord of the Rings: The Fellowship of the Ring (video game)|]]</nowiki></code> || <code><nowiki>[[The Lord of the Rings: The Fellowship of the Ring (video game)|The Fellowship of the Ring]]</nowiki></code> || [[The Lord of the Rings: The Fellowship of the Ring (video game)|The Fellowship of the Ring]]
|
20
|
-
|-
|
21
|
-
! colspan="3" style="text-align: left;" | Redirection
|
22
|
-
|-
|
23
|
-
|| <code><nowiki>[[Bush (43)|]]</nowiki></code> || <code><nowiki>[[Bush (43)|Bush]]</nowiki></code> || [[Bush (43)|Bush]]
|
24
|
-
|-
|
25
|
-
|| <code><nowiki>[[Bush (41)|]]</nowiki></code> || <code><nowiki>[[Bush (41)|Bush]]</nowiki></code> || [[Bush (41)|Bush]]
|
26
|
-
|-
|
27
|
-
! colspan="3" style="text-align: left;" | Normal titles
|
28
|
-
|-
|
29
|
-
|| <code><nowiki>[[Wikipedia:Help|]]</nowiki></code> || <code><nowiki>[[Wikipedia:Help|Help]]</nowiki></code> || [[Wikipedia:Help|Help]]
|
30
|
-
|-
|
31
|
-
! colspan="3" style="text-align: left;" | Users
|
32
|
-
|-
|
33
|
-
|| <code><nowiki>[[User:Example|]]</nowiki></code> || <code><nowiki>[[User:Example|Example]]</nowiki></code> || [[User:Example|Example]]
|
34
|
-
|-
|
35
|
-
|}
|
36
|
-
|
37
|
-
==Where it does not work==
|
38
|
-
===Cite.php <ref> footnotes===
|
39
|
-
<!-- The pipe trick auto-converts, for example, <nowiki>[[Roger Taylor (author)|]]</nowiki> to <nowiki>[[Roger Taylor (author)|Roger Taylor]]</nowiki> -->
|
40
|
-
|
41
|
-
The trick does not work when enclosing between [[wikipedia:footnotes|"ref" tags]]. <code><nowiki><ref>[[Roger Taylor (author)|]]</ref></nowiki></code><ref>[[Roger Taylor (author)|]]</ref> renders in the references list (generated by the <nowiki><references/></nowiki> tag) as:
|
42
|
-
|
43
|
-
<references/>
|
44
|
-
===Edit summaries===
|
45
|
-
<!-- The pipe trick auto-converts, for example, <nowiki>[[WP:SAND|]]</nowiki> to [[WP:SAND|SAND]] -->
|
46
|
-
|
47
|
-
The trick does not work in edit summaries. <code><nowiki>/* Edit summaries and the pipe trick */ as tested in [[WP:SAND|]]</nowiki></code> renders in the edit history as:
|
48
|
-
|
49
|
-
<span class="comment">(<span class="autocomment">[[#Edit summaries and the pipe trick|→]]Edit summaries and the pipe trick:</span> as tested in [[WP:SAND]])</span>
|
50
|
-
|
51
|
-
== Slash trick ==
|
52
|
-
You can achieve the same effect for subpages by adding a slash: <code><nowiki>[[/subpage/]]</nowiki></code> generates the same output as <code><nowiki>[[/subpage|subpage]]</nowiki></code>. Unlike the pipe trick, though, it will not be transformed in the [[wikitext]].
|
53
|
-
|
54
|
-
This trick only works in namespaces where <code><nowiki>[[/subpage]]</nowiki></code> would.
|
55
|
-
|
56
|
-
== Reverse pipe trick ==
|
57
|
-
Typing <tt><nowiki>[[|Agonizer]]</nowiki></tt> on, for example, [[Agonist (disambiguation)]] will cause the link to be expanded to <tt>[[[[Agonizer (disambiguation)]]|Agonizer]]</tt>; similarly on a page with a name containing a comma. Using the reverse pipe trick on a page that has no parentheses or comma in its name is unproductive; the pipe character is automatically removed.
|
58
|
-
|
59
|
-
==Try it!==
|
60
|
-
The best way to understand this is to try it yourself in the [[Wikipedia:Sandbox|sandbox]]. Use one of the examples under "Type this" above, save the page, then immediately edit it again. You'll see the transformation, and it should be clearer exactly what happened.
|
61
|
-
|
62
|
-
==See also==
|
63
|
-
* [[Help:Magic]]
|
64
|
-
* [[Help:Piped link]]
|
65
|
-
* [[m:Help:Piped link]]
|
66
|
-
|
67
|
-
[[Category:Wikipedia features|{{PAGENAME}}]]
|
68
|
-
|