3 <li><a href="#TWiki Text Formatting"> TWiki Text Formatting</a><ul>
4 <li><a href="#TWiki Editing Shorthand"> TWiki Editing Shorthand</a></li>
5 <li><a href="#Using HTML"> Using HTML</a><ul>
6 <li><a href="#Script tags"> Script tags</a></li>
9 <li><a href="#Hyperlinks"> Hyperlinks</a><ul>
10 <li><a href="#Internal Links"> Internal Links</a></li>
11 <li><a href="#External Links"> External Links</a></li>
14 <li><a href="#TWiki Variables"> TWiki Variables</a></li>
15 <li><a href="#TWikiPlugin Formatting Extension"> TWikiPlugin Formatting Extensions</a></li>
16 <li><a href="#Common Editing Errors"> Common Editing Errors</a></li>
22 # <a name="TWiki Text Formatting"></a> TWiki Text Formatting
24 Working in TWiki is as easy as typing in text. You don't need to know HTML, though you can use it if you prefer. Links to topics are created automatically when you enter [[WikiWords]]. And TWiki shorthand gives you all the power of HTML with a simple coding system that takes no time to learn. It's all laid out below.
26 <a name="TWikiShorthand"></a>
28 ## <a name="TWiki Editing Shorthand"></a> TWiki Editing Shorthand
30 <table bgcolor="#ffffff" border="1" cellpadding="3">
31 <tr bgcolor="#ffffff">
32 <th width="50%"> Formatting Command: </th>
33 <th width="25%"> You write: </th>
34 <th width="25%"> You get: </th>
37 <td><strong>Paragraphs:</strong> %BR% Blank lines will create new paragraphs. </td>
43 <td> 1st paragraph <p> 2nd paragraph </p>
47 <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/TWikiVariables#VarTOC]] variable. If you want to <strong>exclude</strong> a heading from the TOC, put <code>!!</code> after the <code>---+</code>. </p>
48 <p> %X% Empty headings are allowed, but won't appear in the table of contents. </p>
62 <td><strong>Bold Text:</strong> %BR% Words get shown in <strong>bold</strong> by enclosing them in <code>*</code> asterisks. </td>
66 <td><strong>Bold</strong></td>
69 <td><strong>Italic Text:</strong> %BR% Words get shown in <em>italic</em> by enclosing them in <code>_</code> underscores. </td>
73 <td><em>Italic</em></td>
76 <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>
80 <td><strong><em>Bold italic</em></strong></td>
83 <td><strong>Fixed Font:</strong> %BR% Words get shown in <code>fixed font</code> by enclosing them in <code>=</code> equal signs. </td>
87 <td><code>Fixed font</code><p>
92 <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>
96 <td><code><b>Bold fixed</b></code></td>
99 <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>
105 <td><em>This works</em>,%BR% _this does not _ </td>
108 <td><strong>Verbatim (Literal) Text:</strong> %BR% Surround code excerpts and other formatted text with <code><verbatim></code> and <code></verbatim></code> tags.%BR% %T% <code>verbatim</code> tags disable HTML code. Use <code><pre></code> and <code></pre></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>
127 <td><strong>Separator (Horizontal Rule):</strong> %BR% Three or more three dashes at the beginning of a line.. </td>
136 <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>
153 <li> A bullet broken over three lines </li>
154 <li> last bullet </li>
159 <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">
161 <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>
162 <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>
163 <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>
166 <td bgcolor="#ecf2f8" style=""> 1. </td>
167 <td bgcolor="#ecf2f8" style=""> Arabic numerals </td>
168 <td bgcolor="#ecf2f8" style=""> 1, 2, 3, 4... </td>
171 <td bgcolor="#ffffff" style=""> A. </td>
172 <td bgcolor="#ffffff" style=""> Uppercase letters </td>
173 <td bgcolor="#ffffff" style=""> A, B, C, D... </td>
176 <td bgcolor="#ecf2f8" style=""> a. </td>
177 <td bgcolor="#ecf2f8" style=""> Lowercase letters </td>
178 <td bgcolor="#ecf2f8" style=""> a, b, c, d... </td>
181 <td bgcolor="#ffffff" style=""> I. </td>
182 <td bgcolor="#ffffff" style=""> Uppercase Roman Numerals </td>
183 <td bgcolor="#ffffff" style=""> I, II, III, IV... </td>
186 <td bgcolor="#ecf2f8" style=""> i. </td>
187 <td bgcolor="#ecf2f8" style=""> Lowercase Roman Numerals </td>
188 <td bgcolor="#ecf2f8" style=""> i, ii, iii, iv... </td>
214 <li type="A"> Sushi </li>
215 <li type="A"> Dim Sum </li>
216 <li type="A"> Fondue </li>
221 <li type="i"> Sushi </li>
222 <li type="i"> Dim Sum </li>
223 <li type="i"> Fondue </li>
228 <td><strong>Definition List:</strong> %BR% Three spaces, a dollar sign, the term, a colon, a space, followed by the definition. </td>
243 <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>
244 <li><code>| *bold* |</code> header cell with text in asterisks </li>
245 <li><code>| center-aligned |</code> cell with at least two, and equal number of spaces on either side </li>
246 <li><code>| right-aligned |</code> cell with more spaces on the left </li>
247 <li><code>| 2 colspan ||</code> and multi-span columns with multiple <tt>|</tt>'s right next to each other </li>
248 <li><code>|^|</code> cell with caret indicating follow-up row of multi-span rows </li>
249 <li> You can split rows over multiple lines by putting a backslash <code>'\'</code> at the end of each line </li>
250 <li> Contents of table cells wrap automatically as determined by the browser </li>
251 </ul> %T% The [[TWiki/TablePlugin]] provides the <code>|^|</code> multiple-span row functionality and additional rendering features </td>
266 <table border="1" cellpadding="0" cellspacing="0" style="border-width: 1px">
268 <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>
269 <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>
270 <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 <td bgcolor="#ecf2f8" style=""> A2 </td>
274 <td align="center" bgcolor="#ecf2f8" style=""> B2 </td>
275 <td align="right" bgcolor="#ecf2f8" style=""> C2 </td>
278 <td bgcolor="#ffffff" style=""> A3 </td>
279 <td align="center" bgcolor="#ffffff" style=""> B3 </td>
280 <td align="right" bgcolor="#ffffff" style=""> C3 </td>
283 <td bgcolor="#ecf2f8" colspan="3" style=""> multi span </td>
286 <td bgcolor="#ffffff" rowspan="3" style=""> A5-7 </td>
287 <td align="center" bgcolor="#ffffff" style=""> 5 </td>
288 <td align="right" bgcolor="#ffffff" style=""> 5 </td>
291 <td bgcolor="#ecf2f8" style=""> six </td>
292 <td bgcolor="#ecf2f8" style=""> six </td>
295 <td bgcolor="#ffffff" style=""> seven </td>
296 <td bgcolor="#ffffff" style=""> seven </td>
299 <td bgcolor="#ecf2f8" style=""> split </td>
300 <td bgcolor="#ecf2f8" style=""> over </td>
301 <td bgcolor="#ecf2f8" style=""> 3 lines </td>
304 <td bgcolor="#ffffff" style=""> A9 </td>
305 <td align="center" bgcolor="#ffffff" style=""> B9 </td>
306 <td align="right" bgcolor="#ffffff" style=""> C9 </td>
312 <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% %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. <p> It's generally a good idea to use the [[Main/TWikiVariables]] %TWIKIWEB% and %MAINWEB% instead of TWiki and Main. </p>
321 <td>[[Main/WebStatistics]]<p>[[Sandbox/WebNotify]]</p>
322 <p>[[Sandbox/WebHome]]</p>
326 <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]]. 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>
328 [[WikiWord#NotThere]]
334 <td>[[Main/WikiWord#NotThere]]<p>[[Main/WebHome#MyAnchor]]</p>
335 <p><a name="MyAnchor"></a> To here </p>
339 <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>
348 <td>[[Main/WikiSyntax]]<p>[[Main/TWikiUsers]]</p>
349 <p> escaped: [[wiki syntax]] </p>
353 <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>
355 [[WikiSyntax][wiki syntax]]
357 [[http://gnu.org][GNU]]
359 <td>[[Main/WikiSyntax]]<p><a href="http://gnu.org" target="_top">GNU</a></p>
363 <td><strong>Prevent a Link:</strong> %BR% Prevent a [[Main/WikiWord]] from being linked by prepending it with an exclamation point. </td>
370 <td><strong>Disable Links:</strong> %BR% You can disable automatic linking of [[Main/WikiWords]] by surrounding text with <code><noautolink></code> and <code></noautolink></code> tags.%BR% %H% It is possible to turn off all auto-linking with a NOAUTOLINK preferences setting. </td>
377 <td> RedHat & SuSE </td>
380 <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>
390 <td><a href="mailto:a@b.com">a@b.com</a><p><a href="mailto:a@b.com">Mail</a></p>
391 <p><a href="mailto:?subject=Hi">Hi</a></p>
396 ## <a name="Using HTML"></a> Using HTML
398 You can use just about any HTML tag without a problem. You can add HTML if there is no TWiki equivalent, for example, write `<strike>deleted text</strike>` to get <strike>deleted text</strike>.
400 %X% There are a few usability and technical considerations to keep in mind:
402 - On collaboration pages, it's better **not** to use HTML, but to use [[TWiki shorthand|Main/WebHome#TWikiShorthand]] instead - this keeps the text uncluttered and easy to edit.
403 - If you use HTML use [XHTML 1.0 Transitional](http://www.w3.org/TR/xhtml1/) syntax.
404 - %X% Script tags may be filtered out, at the discretion of your TWiki administrator.
406 Recommendations when pasting HTML from other sources:
408 - Copy only text between `<body>` and `</body>` tags.
409 - Remove all empty lines. TWiki inserts `<p />` paragraph tags on empty lines, which causes problems if done between HTML tags that do not allow paragraph tags, like for example between table tags.
410 - Remove leading spaces. TWiki might interpret some text as lists.
411 - Do not span a tag over more than one line. TWiki requires that the opening and closing angle brackets - <code>**<...>**</code> - of an HTML tag are on the same line, or the tag will be broken.
412 - In your HTML editing program, save without hard line breaks on text wrap.
414 %T% TWiki converts shorthand notation to HTML for display. To copy a fully marked-up page, simply view the source in your browser and save the contents. If you need to save HTML frequently, you may want to check out TWiki:Plugins/PublishAddOn.
416 ### <a name="Script tags"></a> Script tags
418 You can use HTML `<script>` tags for your TWiki applications. However note that your TWiki administrator can disable `<script>` in topics, and may have chosen to do so for security considerations. TWiki markup and [[TWikiVariables]] are **not** expanded inside script tags.
420 ## <a name="Hyperlinks"></a> Hyperlinks
422 Being able to create links without any special formatting is a core TWiki feature, made possible with [[WikiWords]] and inline URLs.
424 ### <a name="Internal Links"></a> Internal Links
426 - [[GoodStyle]] is a [[WikiWord]] that links to the GoodStyle topic located in the current web.
428 - [[NotExistingYet]] is a topic waiting to be written. Create the topic by clicking on the **?**. (Try clicking, but then, **Cancel** - creating the topic would wreck this example!)
430 ### <a name="External Links"></a> External Links
432 - `http://...`, `https://...`, `ftp://...`, `gopher://...`, `news://...`, `file://...`, `telnet://...` and `mailto:...@...` are linked automatically.
434 - E-mail addresses like `name@domain.com` are linked automatically.
436 - `[[Square bracket rules]]` let you easily create [[non-WikiWord links|Main/WebHome#SquareBrackets]].
437 - You can also write `[[http://yahoo.com Yahoo home page]]` as an easier way of doing external links with descriptive text for the link, such as [Yahoo home page](http://yahoo.com/).
439 ## <a name="TWiki Variables"></a> TWiki Variables
441 TWiki Variables are names that are enclosed in percent signs `%` that are expanded on the fly.
443 - `%TOC%` : Automatically generates a table of contents based on headings in a topic - see the top of this page for an example.
445 - `%WEB%` : The current web, is **%WEB%**.
447 - `%TOPIC%` : The current topic name, is **%TOPIC%**.
449 - `%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.
451 - `%INCLUDE{"SomeTopic"}%` : Server side include, includes another topic. The current web is the default web. Example: <code>**%INCLUDE\{"TWiki.SiteMap"\}%**</code>
453 - `%SEARCH{"sushi"}%` : Inline search showing the search result embedded in a topic. [[FormattedSearch]] gives you control over formatting, useful for creating web-based applications.
455 - [[TWikiPreferences]] defines some site-wide variables. Among others:
456 - **Line break:** Write `%BR%` to start a new line.
457 - **Colored text:** Write: `%RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors` to get: %RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors.
458 - **Documentation Graphics:** Write: `%H% Help, %T% Tip, %X% Alert` to get: %H% Help, %T% Tip, %X% Alert. For more info see [[TWikiDocGraphics]].
460 - There are many more variables, see **[[TWikiVariables]]**.
462 - To "escape" a variable, prefix it with an exclamation mark. Write: `!%SOMEVARIABLE%` to get: %SOMEVARIABLE%.
464 ## <a name="TWikiPlugin Formatting Extension"></a><a name="_TWikiPlugin Formatting Extensio"></a> TWikiPlugin Formatting Extensions
466 Plugins can extend the functionality of TWiki into many other areas. There are a huge number of TWiki plugins available from the [Plugins](http://twiki.org/cgi-bin/view/Plugins) web on TWiki.org.
468 Currently enabled plugins on this TWiki installation, as listed by `%PLUGINDESCRIPTIONS%`:
470 - [[SpreadSheetPlugin]] <span>(any TWiki, 10197)</span>:
471 - [[CommentPlugin]] <span>(Dakar, 11359)</span>: Allows users to quickly post comments to a page without an edit/preview/save cycle
472 - [[EditTablePlugin]] <span>(any TWiki, 11646)</span>:
473 - [[InterwikiPlugin]] <span>(Dakar, $Rev: 11935$)</span>:
474 - [[PreferencesPlugin]] <span>(Dakar, 9839)</span>:
475 - [[SlideShowPlugin]] <span>(Any TWiki, $Rev: 12847$)</span>:
476 - [[SmiliesPlugin]] <span>(Dakar, 8154)</span>:
477 - [[TablePlugin]] <span>(1.020, 12339)</span>:
478 - [[TwistyPlugin]] <span>(1.2.0, $Rev: 12154$)</span>:
480 Check on current Plugin status and settings for this site in [[TWikiPreferences]].
482 ## <a name="Common Editing Errors"></a> Common Editing Errors
484 TWiki formatting rules are fairly simple to use and quick to type. However, there are some things to watch out for, taken from the [[TextFormattingFAQ]]:
486 - **Q:** Text enclosed in angle brackets like `<filename>` is not displayed. How can I show it as it is?
487 - **A:** The `'<'` and `'>'` characters have a special meaning in HTML, they define HTML tags. You need to escape them, so write `'<'` instead of `'<'`, and `'>'` instead of `'>'`. <br /> Example: Type `'prog <filename>'` to get `'prog <filename>'`.
489 - **Q:** Why is the `'&'` character sometimes not displayed?
490 - **A:** The `'&'` character has a special meaning in HTML, it starts a so called character entity, i.e. `'©'` is the `©` copyright character. You need to escape `'&'` to see it as it is, so write `'&'` instead of `'&'`. <br /> Example: Type `'This & that'` to get `'This & that'`.