none
[openafs-wiki.git] / TWiki / TextFormattingRules.mdwn
1 <div>
2   <ul>
3     <li><a href="#Editing"> Editing</a></li>
4     <li><a href="#Using HTML"> Using HTML</a></li>
5     <li><a href="#Hyperlinks"> Hyperlinks</a><ul>
6         <li><a href="#Internal Links"> Internal Links</a></li>
7         <li><a href="#External Links"> External Links</a></li>
8       </ul>
9     </li>
10     <li><a href="#TWiki Variables"> TWiki Variables</a></li>
11     <li><a href="#"Gotchas" when Editing Text"> "Gotchas" when Editing Text</a></li>
12     <li><a href="#TWiki Plugins"> TWiki Plugins</a></li>
13   </ul>
14 </div>
15
16 It is easy to collaborate: just type in your text. You don't need to know HTML at all, though you can use it if you prefer. Links to topics will be created automatically, as long as you follow these simple Text Formatting Rules. [[TextFormattingFAQ]] has answers to frequently asked questions about text formatting. This page is also available as quick reference pop-up window from a link in the Edit screen.
17
18 ## <a name="Editing"></a> Editing
19
20 <table bgcolor="#000000" border="0" cellpadding="0" cellspacing="1">
21   <tr>
22     <td>
23       <table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
24         <tr>
25           <td><strong>Formatting Command:</strong></td>
26           <td><strong>Example: You write:</strong></td>
27           <td><strong>You get:</strong></td>
28         </tr>
29         <tr>
30           <td valign="top"><strong>Paragraphs:</strong><br /> Blank lines will create new paragraphs. </td>
31           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
32 1st paragraph
33
34 2nd paragraph
35 </pre> </font></span></td>
36           <td valign="top"> 1st paragraph <p> 2nd paragraph </p>
37           </td>
38         </tr>
39         <tr>
40           <td valign="top"><strong>Headings:</strong><br /> At least three dashes at the beginning of a line, followed by plus signs and the heading text. One plus creates a level 1 heading (most important), two pluses a level 2 heading; the maximum is level 6. <strong><em>Note:</em></strong> A Table of Content can be created automatically with the <code>%TOC%</code> variable, see [[Main/TWikiVariables]]. </td>
41           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
42 ---++ Sushi
43
44 ---+++ Maguro
45 </pre> </font></span></td>
46           <td valign="top">
47             <h2>Sushi</h2>
48             <p>
49             </p>
50             <h3>Maguro</h3>
51           </td>
52         </tr>
53         <tr>
54           <td valign="top"><strong>Bold Text:</strong><br /> Words get <strong>bold</strong> by enclosing them in <code>*</code> asterisks. </td>
55           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
56 *Bold*
57 </pre> </font></span></td>
58           <td valign="top"><strong>Bold</strong></td>
59         </tr>
60         <tr>
61           <td valign="top"><strong>Italic Text:</strong><br /> Words get <em>italic</em> by enclosing them in <code>_</code> underscores. </td>
62           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
63 _Italic_
64 </pre> </font></span></td>
65           <td valign="top"><em>Italic</em></td>
66         </tr>
67         <tr>
68           <td valign="top"><strong>Bold Italic:</strong><br /> Words get <em>_bold italic</em> by enclosing them in <code>_</code> double-underscores. </td>
69           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
70 __Bold italic__
71 </pre> </font></span></td>
72           <td valign="top"><strong><em>Bold italic</em></strong></td>
73         </tr>
74         <tr>
75           <td valign="top"><strong>Fixed Font:</strong><br /> Words get shown in <code>fixed font</code> by enclosing them in <code>=</code> equal signs. </td>
76           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
77 =Fixed font=
78 </pre> </font></span></td>
79           <td valign="top"><code>Fixed font</code></td>
80         </tr>
81         <tr>
82           <td valign="top"><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>
83           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
84 ==Bold fixed==
85 </pre> </font></span></td>
86           <td valign="top"><code><b>Bold fixed</b></code></td>
87         </tr>
88         <tr>
89           <td valign="top"><strong><em>Note:</em></strong> Make sure to "stick" the <code>* _ = ==</code> signs to the words, e.g. take away spaces. </td>
90           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
91 _This works_,
92 _this not _
93 </pre> </font></span></td>
94           <td valign="top"><em>This works</em>, _this not _ </td>
95         </tr>
96         <tr>
97           <td valign="top"><strong>Verbatim Mode:</strong><br /> Surround code excerpts and other formatted text with <code>&lt;verbatim&gt;</code> and <code>&lt;/verbatim&gt;</code> tags. <br /><strong><em>Note:</em></strong> Use <code>&lt;pre&gt;</code> and <code>&lt;/pre&gt;</code> tags instead if you want that HTML code is interpreted. <br /><strong><em>Note:</em></strong> Each tag must be on a line by itself. </td>
98           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
99 &lt;verbatim&gt;
100 class CatAnimal {
101   void purr() {
102          &lt;code here&gt;
103   }
104 }
105 &lt;/verbatim&gt;
106 </pre> </font></span></td>
107           <td valign="top"><pre>
108 class CatAnimal {
109   void purr() {
110     &lt;code here&gt;
111   }
112 }
113 </pre></td>
114         </tr>
115         <tr>
116           <td valign="top"><strong>Separator:</strong><br /> At least three dashes at the beginning of a line. </td>
117           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
118 -------
119 </pre> </font></span></td>
120           <td valign="top">
121             <hr />
122           </td>
123         </tr>
124         <tr>
125           <td valign="top"><strong>List Item:</strong><br /> Three spaces and an asterisk. </td>
126           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
127         * bullet item
128 </pre> </font></span></td>
129           <td valign="top">
130             <ul>
131               <li> bullet item </li>
132             </ul>
133           </td>
134         </tr>
135         <tr>
136           <td valign="top"><strong>Nested List Item:</strong><br /> Six, nine, ... spaces and an asterisk. </td>
137           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
138                 * nested stuff
139 </pre> </font></span></td>
140           <td valign="top">
141             <ul>
142               <li>
143                 <ul>
144                   <li> nested stuff </li>
145                 </ul>
146               </li>
147             </ul>
148           </td>
149         </tr>
150         <tr>
151           <td valign="top"><strong>Ordered List:</strong><br /> Three spaces and a number. </td>
152           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
153         1 Sushi
154         1 Dim Sum
155 </pre> </font></span></td>
156           <td valign="top">
157             <ol>
158               <li> Sushi </li>
159               <li> Dim Sum </li>
160             </ol>
161           </td>
162         </tr>
163         <tr>
164           <td valign="top"><strong>Definition List:</strong><br /> Three spaces, the term, a colon, a space, followed by the definition. <br /><strong><em>Note:</em></strong> Terms with spaces are not supported. In case you do have a term with more then one word, separate the words with dashes or with the <code>&amp;nbsp;</code> non-breaking-space entity. </td>
165           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
166         Sushi: Japan
167         Dim&amp;nbsp;Sum: S.F.
168 </pre> </font></span></td>
169           <td valign="top">
170             <dl>
171               <dt> Sushi</dt>
172               <dd> Japan </dd>
173               <dt> Dim Sum</dt>
174               <dd> S.F. </dd>
175             </dl>
176           </td>
177         </tr>
178         <tr>
179           <td valign="top"><strong>Table:</strong><br /> Optional spaces followed by the cells enclosed in vertical bars. <br /><strong><em>Note:</em></strong> <code>| *bold* |</code> cells are rendered as table headers. <br /><strong><em>Note:</em></strong> <code>|   spaced   |</code> cells are rendered center aligned. <br /><strong><em>Note:</em></strong> <code>|     spaced |</code> cells are rendered right aligned. <br /><strong><em>Note:</em></strong> <code>| 2 colspan ||</code> cells are rendered as multi-span columns. <br /><strong><em>Note:</em></strong> In case you have a long row and you want it to be more readable when you edit the table you can split the row into lines that end with a <code>'\'</code> backslash character. <br />
180           </td>
181           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
182 | *L* | *C* | *R* |
183 | A2 |  2  |  2 |
184 | A3 |  3  |  3 |
185 | multi span |||
186 | A4 \  | next \  | next |
187 </pre> </font></span></td>
188           <td valign="top">
189             <table border="1" cellpadding="0" cellspacing="0">
190               <tr>
191                 <th bgcolor="#99CCCC"><strong> L </strong></th>
192                 <th bgcolor="#99CCCC"><strong> C </strong></th>
193                 <th bgcolor="#99CCCC"><strong> R </strong></th>
194               </tr>
195               <tr>
196                 <td> A2 </td>
197                 <td align="center"> 2 </td>
198                 <td align="right"> 2 </td>
199               </tr>
200               <tr>
201                 <td> A3 </td>
202                 <td align="center"> 3 </td>
203                 <td align="right"> 3 </td>
204               </tr>
205               <tr>
206                 <td colspan="3"> multi span </td>
207               </tr>
208               <tr>
209                 <td> A4 </td>
210                 <td> next </td>
211                 <td> next </td>
212               </tr>
213             </table>
214           </td>
215         </tr>
216         <tr>
217           <td valign="top"><strong>WikiWord Links:</strong><br /> CapitalizedWordsStuckTogether (or [[Main/WikiWords]]) will produce a link automatically. <br /><strong><em>Note:</em></strong> In case you want to link to a topic in a different %WIKITOOLNAME% web write <code>Webname.TopicName</code>. </td>
218           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
219 WebNotify
220
221 Know.ReadmeFirst
222 </pre> </font></span></td>
223           <td valign="top">[[Main/WebNotify]]<p>[[Know/ReadmeFirst]]</p>
224           </td>
225         </tr>
226         <tr>
227           <td valign="top"><strong>Forced Links:</strong><br /> You can create a forced internal link by enclosing words in double square brackets. <br /><strong><em>Note:</em></strong> Text within the brackets may contain optional spaces; the topic name is formed by capitalizing the initial letter and by removing the spaces; i.e. <code>[[text formatting FAQ]]</code> links to topic [[Main/TextFormattingFAQ]]. You can also refer to a different web and use anchors. </td>
228           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
229 [[wiki syntax]]
230
231 [[Main.TWiki users]]
232 </pre> </font></span></td>
233           <td valign="top">[[Main/WikiSyntax]]<p>[[Main/TWikiUsers]]</p>
234           </td>
235         </tr>
236         <tr>
237           <td valign="top"><strong>Specific Links:</strong><br /> Create a link where you can specify the link text and the link reference separately, using nested square brackets like <code>[[reference][text]]</code>. Internal link references (i.e. [[Main/WikiSyntax]]) and external link references (i.e. <a href="http://TWiki.org/" target="_top">http://TWiki.org/</a>) are supported. The same <strong><em>Forced Links</em></strong> rules apply for internal link references. Anchor names can be added as well, like <code>[[WebHome#MyAnchor][go home]]</code> and <code>[[http://www.yahoo.com/#somewhere][Yahoo!]]</code>. </td>
238           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
239 [[WikiSyntax][syntax]]
240
241 [[http://gnu.org][GNU]]
242 </pre> </font></span></td>
243           <td valign="top">[[Main/WikiSyntax]]<p><a href="http://gnu.org" target="_top">GNU</a></p>
244           </td>
245         </tr>
246         <tr>
247           <td valign="top"><strong>Anchors:</strong><br /> You can define a link reference inside a %WIKITOOLNAME% 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]]. 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>
248           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
249 [[WebHome#NotThere]]
250
251 [[#MyAnchor][Jump]]
252
253 #MyAnchor To here
254 </pre> </font></span></td>
255           <td valign="top">[[Main/WebHome#NotThere]]<p>[[Main/WebHome#MyAnchor]]</p>
256             <p><a name="MyAnchor"></a> To here </p>
257           </td>
258         </tr>
259         <tr>
260           <td valign="top"><strong>Prevent a Link:</strong><br /> Prevent a [[Main/WikiWord]] from being linked by prepending it with the <code>&lt;nop&gt;</code> tag. </td>
261           <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
262 &lt;nop&gt;SunOS
263 </pre> </font></span></td>
264           <td valign="top"> SunOS </td>
265         </tr>
266       </table>
267     </td>
268   </tr>
269 </table>
270
271 ## <a name="Using HTML"></a> Using HTML
272
273 Most HTML tags will work, but it's almost always preferable not to use HTML, so that the markup remains easy for everyone to edit.
274
275 ## <a name="Hyperlinks"></a> Hyperlinks
276
277 Being able to create links without any formatting required is a core TWiki feature, made possible using [[WikiNames]]. With the latest version of TWiki linking rules, a simple extension of the syntax provides an new set of flexible linking options.
278
279 ### <a name="Internal Links"></a> Internal Links
280
281 - [[GoodStyle]] is a [[WikiWord]] that links to the GoodStyle topic located in the current %WIKITOOLNAME% web.
282 - [[NotExistingYet]] is a topic waiting to be written. You could create that topic by clicking on the question mark. (Do not create that topic; you would wreck this example!)
283
284 ### <a name="External Links"></a> External Links
285
286 - `http://...`, `https://...`, `ftp://...` and `mailto:...@...` are linked automatically.
287 - Email addresses like `name@domain.com` are linked automatically.
288
289 ## <a name="TWiki Variables"></a> TWiki Variables
290
291 Variables are names that are enclosed in percent signs; they get expanded on the fly.
292
293 - `%TOC%` : The table of content, is based on headings in a topic.
294 - `%WEB%` : The current web, is **%WEB%** .
295 - `%TOPIC%` : The current topic name, is **%TOPIC%** .
296 - `%ATTACHURL%` : The attachment URL of the current topic. Example usage: If you attach a file to a topic you can refer to it as <code>**%ATTACHURL%/image.gif**</code> to show the URL of the file or the image in your text.
297 - `%INCLUDE{"SomeTopic"}%` : Server side include, includes another topic. The current %WIKITOOLNAME% web is the default web. Example: <code>**%INCLUDE\{"TWiki.TWikiWebsTable"\}%**</code>
298 - There are many more variables, see [[TWikiVariables]].
299
300 ## <a name="&quot;Gotchas&quot; when Editing Text"></a> "Gotchas" when Editing Text
301
302 The formatting rules are fairly simple to use and fast to type. However, there are some things to watch out for:
303
304 - **Q:** Text enclosed in angle brackets like `<filename>` is not displayed. How can I show it as it is?
305   - **A:** The `'<'` and `'>'` characters have a special meaning in HTML, they define HTML tags. You need to escape them, so write `'&lt;'` instead of `'<'`, and `'&gt;'` instead of `'>'`. <br /> Example: Type `'prog &lt;filename&gt;'` to get `'prog <filename>'`.
306
307 - **Q:** Why is the `'&'` character sometimes not displayed?
308   - **A:** The `'&'` character has a special meaning in HTML, it starts a so called character entity, i.e. `'&copy;'` is the `©` copyright character. You need to escape `'&'` to see it as it is, so write `'&amp;'` instead of `'&'`. <br /> Example: Type `'This &amp; that'` to get `'This & that'`.
309
310 - See more [[TextFormattingFAQs]]
311
312 ## <a name="TWiki Plugins"></a> TWiki Plugins
313
314 Plugins provide additional text formatting rules and can extend the functionality of %WIKITOOLNAME% into many other areas. Available Plugins are located in the [[Plugins|Main/TWiki:Plugins]] web. Currently enabled plugins on this site are:
315
316 - [[SpreadSheetPlugin]] <span>(any TWiki, 10197)</span>:
317 - [[CommentPlugin]] <span>(Dakar, 11359)</span>: Allows users to quickly post comments to a page without an edit/preview/save cycle
318 - [[EditTablePlugin]] <span>(any TWiki, 11646)</span>:
319 - [[InterwikiPlugin]] <span>(Dakar, $Rev: 11935$)</span>:
320 - [[PreferencesPlugin]] <span>(Dakar, 9839)</span>:
321 - [[SlideShowPlugin]] <span>(Any TWiki, $Rev: 12847$)</span>:
322 - [[SmiliesPlugin]] <span>(Dakar, 8154)</span>:
323 - [[TablePlugin]] <span>(1.020, 12339)</span>:
324 - [[TwistyPlugin]] <span>(1.2.0, $Rev: 12154$)</span>:
325
326 Check on current Plugin status and settings for this site in [[TWikiPreferences]].
327
328 -- [[MikeMannix]] - 30 Aug 2001