attachment upload
[openafs-wiki.git] / TWiki / TWikiEditingShorthand.mdwn
1 ## <a name="TWiki Editing Shorthand"></a> TWiki Editing Shorthand
2
3 <table bgcolor="#ffffff" border="1" cellpadding="3">
4   <tr bgcolor="#ffffff">
5     <th width="50%"> Formatting Command: </th>
6     <th width="25%"> You write: </th>
7     <th width="25%"> You get: </th>
8   </tr>
9   <tr valign="top">
10     <td><strong>Paragraphs:</strong> %BR% Blank lines will create new paragraphs. </td>
11     <td><pre>
12 1st paragraph
13
14 2nd paragraph
15 </pre></td>
16     <td>
17       <p> 1st paragraph </p>
18       <p> 2nd paragraph </p>
19     </td>
20   </tr>
21   <tr valign="top">
22     <td><strong>Headings:</strong> %BR% Three or more dashes at the beginning of a line, followed by plus signs and the heading text. One plus creates a top level heading, two pluses a second level heading, etc. The maximum heading depth is 6. <p> You can create a table of contents with the [[Main/VarTOC]] variable. If you want to <strong>exclude</strong> a heading from the TOC, put <code>!!</code> after the <code>---+</code>. </p>
23       <p> %X% Empty headings are allowed, but won't appear in the table of contents. </p>
24     </td>
25     <td><pre>
26 ---++ Sushi
27 ---+++ Maguro
28 ---+++!! Not in TOC
29 </pre></td>
30     <td>
31       <p>
32       </p>
33       <h2>Sushi</h2>
34       <h3>Maguro</h3>
35       <h3>Not in TOC</h3>
36     </td>
37   </tr>
38   <tr valign="top">
39     <td><strong>Bold Text:</strong> %BR% Words get shown in <strong>bold</strong> by enclosing them in <code>*</code> asterisks. </td>
40     <td><pre>
41 *Bold*
42 </pre></td>
43     <td>
44       <p><strong>Bold</strong></p>
45     </td>
46   </tr>
47   <tr valign="top">
48     <td><strong>Italic Text:</strong> %BR% Words get shown in <em>italic</em> by enclosing them in <code>_</code> underscores. </td>
49     <td><pre>
50 _Italic_
51 </pre></td>
52     <td>
53       <p><em>Italic</em></p>
54     </td>
55   </tr>
56   <tr valign="top">
57     <td><strong>Bold Italic:</strong> %BR% Words get shown in <strong><em>bold italic</em></strong> by enclosing them in <code>__</code> double-underscores. </td>
58     <td><pre>
59 __Bold italic__
60 </pre></td>
61     <td>
62       <p><strong><em>Bold italic</em></strong></p>
63     </td>
64   </tr>
65   <tr valign="top">
66     <td><strong>Fixed Font:</strong> %BR% Words get shown in <code>fixed font</code> by enclosing them in <code>=</code> equal signs. </td>
67     <td><pre>
68 =Fixed font=
69 </pre></td>
70     <td>
71       <p><code>Fixed font</code></p>
72       <p>
73       </p>
74     </td>
75   </tr>
76   <tr valign="top">
77     <td><strong>Bold Fixed Font:</strong> %BR% Words get shown in <code><b>bold fixed font</b></code> by enclosing them in <code><b></b></code> double equal signs. </td>
78     <td><pre>
79 ==Bold fixed==
80 </pre></td>
81     <td>
82       <p><code><b>Bold fixed</b></code></p>
83     </td>
84   </tr>
85   <tr valign="top">
86     <td> %T% You can follow the closing bold, italic, or other (<code>* _ __ = ==</code>) indicator with normal punctuation, such as commas and full stops. <p> %X% Make sure there is no space between the text and the indicators. </p>
87     </td>
88     <td><pre>
89 _This works_,
90 _this does not _
91 </pre></td>
92     <td>
93       <p><em>This works</em>,%BR% _this does not _ </p>
94     </td>
95   </tr>
96   <tr valign="top">
97     <td><strong>Verbatim Text:</strong> %BR% Surround code excerpts and other formatted text with <code>&lt;verbatim&gt;</code> and <code>&lt;/verbatim&gt;</code> tags.%BR% %T% <code>verbatim</code> tags disable HTML code. Use <code>&lt;pre&gt;</code> and <code>&lt;/pre&gt;</code> tags instead if you want the HTML code within the tags to be interpreted.%BR% <strong><em>%X% NOTE:</em></strong> Preferences variables (* Set NAME = value) are set within verbatim tags. </td>
98     <td><pre>
99 &lt;verbatim&gt;
100 class CatAnimal {
101   void purr() {
102     &lt;code here&gt;
103   }
104 }
105 &lt;/verbatim&gt;
106 </pre></td>
107     <td><pre>
108 class CatAnimal {
109   void purr() {
110     &lt;code here&gt;
111   }
112 }
113 </pre></td>
114   </tr>
115   <tr valign="top">
116     <td><strong>Separator (Horizontal Rule):</strong> %BR% Three or more three dashes at the beginning of a line.. </td>
117     <td><pre>
118 -------
119 </pre></td>
120     <td>
121       <p>
122       </p>
123       <hr />
124     </td>
125   </tr>
126   <tr valign="top">
127     <td><strong>Bulleted List:</strong> %BR% Multiple of three spaces, an asterisk, and another space.%BR% %H% For all the list types, you can break a list item over several lines by indenting lines after the first one by <strong>at least 3 spaces</strong>. </td>
128     <td><pre>
129    * level 1
130       * level 2
131    * back on 1
132    * A bullet
133      broken over
134      three lines
135    * last bullet
136 </pre></td>
137     <td>
138       <p>
139       </p>
140       <ul>
141         <li> level 1 <ul>
142             <li> level 2 </li>
143           </ul>
144         </li>
145         <li> back on 1 </li>
146         <li> A bullet broken over three lines </li>
147         <li> last bullet </li>
148       </ul>
149     </td>
150   </tr>
151   <tr valign="top">
152     <td><strong>Numbered List:</strong> %BR% Multiple of three spaces, a type character, a dot, and another space. Several types are available besides a number: <table border="1" cellpadding="0" cellspacing="0" style="border-width: 1px">
153         <tr>
154           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=0;table=1;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">Type</font></a></th>
155           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=1;table=1;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">Generated Style</font></a></th>
156           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=2;table=1;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">Sample Sequence</font></a></th>
157         </tr>
158         <tr>
159           <td bgcolor="#ecf2f8" style=""> 1. </td>
160           <td bgcolor="#ecf2f8" style=""> Arabic numerals </td>
161           <td bgcolor="#ecf2f8" style=""> 1, 2, 3, 4... </td>
162         </tr>
163         <tr>
164           <td bgcolor="#ffffff" style=""> A. </td>
165           <td bgcolor="#ffffff" style=""> Uppercase letters </td>
166           <td bgcolor="#ffffff" style=""> A, B, C, D... </td>
167         </tr>
168         <tr>
169           <td bgcolor="#ecf2f8" style=""> a. </td>
170           <td bgcolor="#ecf2f8" style=""> Lowercase letters </td>
171           <td bgcolor="#ecf2f8" style=""> a, b, c, d... </td>
172         </tr>
173         <tr>
174           <td bgcolor="#ffffff" style=""> I. </td>
175           <td bgcolor="#ffffff" style=""> Uppercase Roman Numerals </td>
176           <td bgcolor="#ffffff" style=""> I, II, III, IV... </td>
177         </tr>
178         <tr>
179           <td bgcolor="#ecf2f8" style=""> i. </td>
180           <td bgcolor="#ecf2f8" style=""> Lowercase Roman Numerals </td>
181           <td bgcolor="#ecf2f8" style=""> i, ii, iii, iv... </td>
182         </tr>
183       </table>
184     </td>
185     <td><pre>
186    1. Sushi
187    1. Dim Sum
188    1. Fondue
189
190    A. Sushi
191    A. Dim Sum
192    A. Fondue
193
194    i. Sushi
195    i. Dim Sum
196    i. Fondue
197 </pre></td>
198     <td>
199       <p>
200       </p>
201       <ol>
202         <li> Sushi </li>
203         <li> Dim Sum </li>
204         <li> Fondue </li>
205       </ol>
206       <p>
207       </p>
208       <ol>
209         <li type="A"> Sushi </li>
210         <li type="A"> Dim Sum </li>
211         <li type="A"> Fondue </li>
212       </ol>
213       <p>
214       </p>
215       <ol>
216         <li type="i"> Sushi </li>
217         <li type="i"> Dim Sum </li>
218         <li type="i"> Fondue </li>
219       </ol>
220     </td>
221   </tr>
222   <tr valign="top">
223     <td><strong>Definition List:</strong> %BR% Three spaces, a dollar sign, the term, a colon, a space, followed by the definition. <p> Deprecated syntax: Three spaces, the term with no spaces, a colon, a space, followed by the definition. </p>
224     </td>
225     <td><pre>
226    $ Sushi: Japan
227    $ Dim Sum: S.F.
228 </pre></td>
229     <td>
230       <p>
231       </p>
232       <dl>
233         <dt> Sushi </dt>
234         <dd> Japan </dd>
235         <dt> Dim Sum </dt>
236         <dd> S.F. </dd>
237       </dl>
238     </td>
239   </tr>
240   <tr valign="top">
241     <td><strong>Table:</strong> %BR% Each row of the table is a line containing of one or more cells. Each cell starts and ends with a vertical bar '|'. Any spaces at the beginning of a line are ignored. <ul>
242         <li><code>| *bold* |</code> header cell with text in asterisks </li>
243         <li><code>|   center-aligned   |</code> cell with at least two, and equal number of spaces on either side </li>
244         <li><code>|      right-aligned |</code> cell with more spaces on the left </li>
245         <li><code>| 2 colspan ||</code> and multi-span columns with multiple <tt>|</tt>'s right next to each other </li>
246         <li><code>|^|</code> cell with caret indicating follow-up row of multi-span rows </li>
247         <li> You can split rows over multiple lines by putting a backslash <code>'\'</code> at the end of each line </li>
248         <li> Contents of table cells wrap automatically as determined by the browser </li>
249         <li> Use <code>%VBAR%</code> or <code>&amp;#124;</code> to add <code>|</code> characters in tables. </li>
250         <li> Use <code>%CARET%</code> or <code>&amp;#94;</code> to add <code>^</code> characters in tables. </li>
251       </ul> %T% The %SYSTEMWEB%.TablePlugin provides the <code>|^|</code> multiple-span row functionality and additional rendering features </td>
252     <td><pre>
253 | *L* | *C* | *R* |
254 | A2 |  B2  |  C2 |
255 | A3 |  B3  |  C3 |
256 | multi span |||
257 | A5-7 |  5  |  5 |
258 |^| six | six |
259 |^| seven | seven |
260 | split\
261   | over\
262   | 3 lines |
263 | A9 |  B9  |  C9 |
264 </pre></td>
265     <td>
266       <p>
267       </p>
268       <table border="1" cellpadding="0" cellspacing="0" style="border-width: 1px">
269         <tr>
270           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=0;table=2;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">L</font></a></th>
271           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=1;table=2;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">C</font></a></th>
272           <th bgcolor="#6b7f93" maxcols="0" style=""><a href="http://localhost?sortcol=2;table=2;up=0#sorted_table" rel="nofollow" title="Sort by this column"><font color="#ffffff">R</font></a></th>
273         </tr>
274         <tr>
275           <td bgcolor="#ecf2f8" style=""> A2 </td>
276           <td align="center" bgcolor="#ecf2f8" style=""> B2 </td>
277           <td align="right" bgcolor="#ecf2f8" style=""> C2 </td>
278         </tr>
279         <tr>
280           <td bgcolor="#ffffff" style=""> A3 </td>
281           <td align="center" bgcolor="#ffffff" style=""> B3 </td>
282           <td align="right" bgcolor="#ffffff" style=""> C3 </td>
283         </tr>
284         <tr>
285           <td bgcolor="#ecf2f8" colspan="3" style=""> multi span </td>
286         </tr>
287         <tr>
288           <td bgcolor="#ffffff" rowspan="3" style=""> A5-7 </td>
289           <td align="center" bgcolor="#ffffff" style=""> 5 </td>
290           <td align="right" bgcolor="#ffffff" style=""> 5 </td>
291         </tr>
292         <tr>
293           <td bgcolor="#ecf2f8" style=""> six </td>
294           <td bgcolor="#ecf2f8" style=""> six </td>
295         </tr>
296         <tr>
297           <td bgcolor="#ffffff" style=""> seven </td>
298           <td bgcolor="#ffffff" style=""> seven </td>
299         </tr>
300         <tr>
301           <td bgcolor="#ecf2f8" style=""> split </td>
302           <td bgcolor="#ecf2f8" style=""> over </td>
303           <td bgcolor="#ecf2f8" style=""> 3 lines </td>
304         </tr>
305         <tr>
306           <td bgcolor="#ffffff" style=""> A9 </td>
307           <td align="center" bgcolor="#ffffff" style=""> B9 </td>
308           <td align="right" bgcolor="#ffffff" style=""> C9 </td>
309         </tr>
310       </table>
311     </td>
312   </tr>
313   <tr valign="top">
314     <td><strong>WikiWord Links:</strong> %BR% CapitalizedWordsStuckTogether (or [[Main/WikiWords]]) will produce a link automatically if preceded by whitespace or parenthesis. %BR% %T% If you want to link to a topic in a different web write <code>Otherweb.TopicName</code>. %BR% To link to a topic in a subweb write <code>Otherweb.Subweb.TopicName</code>.%BR% %H% The link label excludes the name of the web, e.g. only the topic name is shown. As an exception, the name of the web is shown for the WebHome topic. %BR% %X% Dots <code>'.'</code> are used to separate webs and subwebs from topic names and therefore cannot be used in topic names. <p> It's generally a good idea to use the [[Main/TWikiVariables]] %SYSTEMWEB% and %USERSWEB% instead of TWiki and Main. </p>
315     </td>
316     <td><pre>
317 WebStatistics
318
319 Sandbox.WebNotify
320
321 Sandbox.WebHome
322
323 Sandbox.Subweb.TopicName
324 </pre></td>
325     <td>
326       <p>[[Main/WebStatistics]]</p>
327       <p>[[Sandbox/WebNotify]]</p>
328       <p>[[Sandbox/WebHome]]</p>
329       <p><a href="#MyAnchor" title="simulated link">TopicName</a></p>
330     </td>
331   </tr>
332   <tr valign="top">
333     <td><strong>Anchors:</strong> %BR% You can define a reference inside a TWiki topic (called an anchor name) and link to that. To <strong><em>define</em></strong> an anchor write <code>#AnchorName</code> at the beginning of a line. The anchor name must be a [[Main/WikiWord]] of no more than 32 characters. To <strong><em>link to</em></strong> an anchor name use the <code>[[MyTopic#MyAnchor]]</code> syntax. You can omit the topic name if you want to link within the same topic. </td>
334     <td><pre>
335 [[WikiWord#NotThere]]
336
337 [[#MyAnchor][Jump]]
338
339 #MyAnchor To here
340 </pre></td>
341     <td>
342       <p>[[Main/WikiWord#NotThere]]</p>
343       <p>[[Main/WebHome#MyAnchor]]</p>
344       <p><a name="MyAnchor"></a> To here </p>
345     </td>
346   </tr>
347   <tr valign="top">
348     <td><a name="HeRe"></a> <strong>Forced Links:</strong> %BR% You can create a forced internal link by enclosing words in double square brackets. %BR% Text within the brackets may contain optional spaces; the topic name is formed by capitalizing the initial letter and by removing the spaces; for example, <code>[[text formatting FAQ]]</code> links to topic [[Main/TextFormattingFAQ]]. You can also refer to a different web and use anchors. %BR% %T% To "escape" double square brackets that would otherwise make a link, prefix the leading left square bracket with an exclamation point. </td>
349     <td><pre>
350 [[wiki syntax]]
351
352 [[Main.TWiki groups]]
353
354 escaped:
355 ![[wiki syntax]]
356 </pre></td>
357     <td>
358       <p>[[Main/WikiSyntax]]</p>
359       <p>[[USERSWEB/TWikiGroups]]</p>
360       <p> escaped: [[wiki syntax]] </p>
361     </td>
362   </tr>
363   <tr valign="top">
364     <td><strong>Specific Links:</strong> %BR% You can create a link where you specify the link text and the URL separately using nested square brackets <code>[[reference][text]]</code>. Internal link references (e.g. [[Main/WikiSyntax]]) and URLs (e.g. <a href="http://TWiki.org/" target="_top">http://TWiki.org/</a>) are both supported. The rules described under <strong><em>Forced Links</em></strong> apply for internal link references. %BR% %T% Anchor names can be added as well, to create a link to a specific place in a topic. </td>
365     <td><pre>
366 [[WikiSyntax][wiki syntax]]
367
368 [[http://gnu.org][GNU]]
369 </pre></td>
370     <td>
371       <p>[[Main/WikiSyntax]]</p>
372       <p><a href="http://gnu.org" target="_top">GNU</a></p>
373     </td>
374   </tr>
375   <tr valign="top">
376     <td><strong>Prevent a Link:</strong> %BR% Prevent a [[Main/WikiWord]] from being linked by prepending it with an exclamation point. </td>
377     <td><pre>
378 !SunOS
379 </pre></td>
380     <td> SunOS </td>
381   </tr>
382   <tr valign="top">
383     <td><strong>Disable Links:</strong> %BR% You can disable automatic linking of [[Main/WikiWords]] by surrounding text with <code>&lt;noautolink&gt;</code> and <code>&lt;/noautolink&gt;</code> tags.%BR% %H% It is possible to turn off all auto-linking with a NOAUTOLINK preferences setting. </td>
384     <td><pre>
385  &lt;noautolink&gt;
386  RedHat &amp; SuSE
387  &lt;/noautolink&gt;
388 </pre></td>
389     <td>
390       <p> RedHat &amp; SuSE </p>
391     </td>
392   </tr>
393   <tr valign="top">
394     <td><strong>Mailto Links:</strong> %BR% E-mail addresses are linked automatically. To create e-mail links that have more descriptive link text, specify subject lines or message bodies, or omit the e-mail address, you can write <code>[[mailto:user@domain][descriptive text]]</code>. </td>
395     <td><pre>
396 a@b.com
397
398 [[mailto:a@b.com]\
399 [Mail]]
400
401 [[mailto:?subject=\
402 Hi][Hi]]
403 </pre></td>
404     <td>
405       <p><a href="mailto:a@b.com">a@b.com</a></p>
406       <p><a href="mailto:a@b.com">Mail</a></p>
407       <p><a href="mailto:?subject=Hi">Hi</a></p>
408     </td>
409   </tr>
410   <tr>
411     <td><strong>Literal content:</strong> %BR% TWiki generates HTML code from TWiki shorthand. <strong>Experts</strong> surround anything that must be output literally in the HTML code, without the application of TWiki shorthand rules, with <code>&lt;literal&gt;..&lt;/literal&gt;</code> tags. %X% any HTML within literal tags <strong>must</strong> be well formed i.e. all tags must be properly closed before the end of the literal block. %I% TWiki Variables are expanded within literal blocks. </td>
412     <td><pre>
413 &lt;literal&gt;
414 | Not | A | Table |
415 &lt;literal&gt;
416 </pre></td>
417     <td> | Not | A | Table | </td>
418   </tr>
419   <tr>
420     <td><strong>Protected content:</strong> %BR% <strong>Experts</strong> protect text from mangling by WYSIWYG editors using <code>&lt;sticky&gt;..&lt;/sticky&gt;</code> tags. Sticky tags don't have any effect on normal topic display; they are only relevant when content has to be protected from a WYSIWYG editor (usually because it isn't well-formed HTML, or because it is HTML that WYSIWYG would normally filter out or modify). Protected content appears as plain text in the WYSIWYG editor. </td>
421     <td><code>&lt;sticky&gt;</code> <pre>
422 &lt;div&gt;
423 This div is required
424 &lt;/div&gt;
425 </pre> <code>&lt;sticky&gt;</code></td>
426     <td><sticky><div> This div is required </div></sticky></td>
427   </tr>
428 </table>