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="#HTML and TWiki Usability"> HTML and TWiki Usability</a></li>
7 <li><a href="#TWiki HTML Rendering"> TWiki HTML Rendering</a></li>
10 <li><a href="#Hyperlinks"> Hyperlinks</a><ul>
11 <li><a href="#Internal Links"> Internal Links</a></li>
12 <li><a href="#External Links"> External Links</a></li>
15 <li><a href="#TWiki Variables"> TWiki Variables</a></li>
16 <li><a href="#TWikiPlugin Formatting Extension"> TWikiPlugin Formatting Extensions</a></li>
17 <li><a href="#Common Editing Errors"> Common Editing Errors</a></li>
23 # <a name="TWiki Text Formatting"></a> TWiki Text Formatting
25 Working in TWiki is as easy as typing in text - **exactly like email**. 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 layed out below - refer back to this page in a pop-up window from the **Edit** screen.
27 <a name="TWikiShorthand"></a>
29 ## <a name="TWiki Editing Shorthand"></a> TWiki Editing Shorthand
31 <table bgcolor="#000000" border="1" cellpadding="3" cellspacing="1">
32 <tr bgcolor="#ffffff">
33 <td><strong>Formatting Command:</strong></td>
34 <td><strong>Example: You write:</strong></td>
35 <td><strong>You get:</strong></td>
37 <tr bgcolor="#ffffff">
38 <td valign="top"><strong>Paragraphs:</strong> %BR% Blank lines will create new paragraphs. </td>
39 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
43 </pre> </font></span></td>
44 <td valign="top"> 1st paragraph <p> 2nd paragraph </p>
47 <tr bgcolor="#ffffff">
48 <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]]. Any heading text after <code>!!</code> is excluded from the TOC; for example, write <code>---+!! text</code> if you do not want to list a header in the TOC. </td>
49 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
53 </pre> </font></span></td>
61 <tr bgcolor="#ffffff">
62 <td valign="top"><strong>Bold Text:</strong> %BR% Words get <strong>bold</strong> by enclosing them in <code>*</code> asterisks. </td>
63 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
65 </pre> </font></span></td>
66 <td valign="top"><strong>Bold</strong></td>
68 <tr bgcolor="#ffffff">
69 <td valign="top"><strong>Italic Text:</strong> %BR% Words get <em>italic</em> by enclosing them in <code>_</code> underscores. </td>
70 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
72 </pre> </font></span></td>
73 <td valign="top"><em>Italic</em></td>
75 <tr bgcolor="#ffffff">
76 <td valign="top"><strong>Bold Italic:</strong> %BR% Words get <em>_bold italic</em> by enclosing them in <code>_</code> double-underscores. </td>
77 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
79 </pre> </font></span></td>
80 <td valign="top"><strong><em>Bold italic</em></strong></td>
82 <tr bgcolor="#ffffff">
83 <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>
84 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
86 </pre> </font></span></td>
87 <td valign="top"><code>Fixed font</code></td>
89 <tr bgcolor="#ffffff">
90 <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>
91 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
93 </pre> </font></span></td>
94 <td valign="top"><code><b>Bold fixed</b></code></td>
96 <tr bgcolor="#ffffff">
97 <td valign="top"><strong><em>Note:</em></strong> Make sure to "stick" the <code>* _ = ==</code> signs to the words, that is, take away spaces. </td>
98 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
101 </pre> </font></span></td>
102 <td valign="top"><em>This works</em>, _this not _ </td>
104 <tr bgcolor="#ffffff">
105 <td valign="top"><strong>Verbatim Mode:</strong> %BR% Surround code excerpts and other formatted text with <code><verbatim></code> and <code></verbatim></code> tags. %BR% <strong><em>Note:</em></strong> Use <code><pre></code> and <code></pre></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>
106 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
114 </pre> </font></span></td>
115 <td valign="top"><pre>
123 <tr bgcolor="#ffffff">
124 <td valign="top"><strong>Separator:</strong> %BR% At least three dashes at the beginning of a line. </td>
125 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
127 </pre> </font></span></td>
132 <tr bgcolor="#ffffff">
133 <td valign="top"><strong>List Item:</strong> %BR% Three spaces and an asterisk. </td>
134 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
136 </pre> </font></span></td>
139 <li> bullet item </li>
143 <tr bgcolor="#ffffff">
144 <td valign="top"><strong>Nested List Item:</strong> %BR% Six, nine, ... spaces and an asterisk. </td>
145 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
147 </pre> </font></span></td>
152 <li> nested stuff </li>
158 <tr bgcolor="#ffffff">
159 <td valign="top"><strong>Ordered List:</strong> %BR% Three spaces and a number. </td>
160 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
163 </pre> </font></span></td>
171 <tr bgcolor="#ffffff">
172 <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>&nbsp;</code> non-breaking-space entity. </td>
173 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
175 Dim&nbsp;Sum: S.F.
176 </pre> </font></span></td>
186 <tr bgcolor="#ffffff">
187 <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% </td>
188 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
194 </pre> </font></span></td>
196 <table border="1" cellpadding="0" cellspacing="0">
198 <th bgcolor="#99CCCC"><strong> L </strong></th>
199 <th bgcolor="#99CCCC"><strong> C </strong></th>
200 <th bgcolor="#99CCCC"><strong> R </strong></th>
204 <td align="center"> 2 </td>
205 <td align="right"> 2 </td>
209 <td align="center"> 3 </td>
210 <td align="right"> 3 </td>
213 <td colspan="3"> multi span </td>
223 <tr bgcolor="#ffffff">
224 <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>
225 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
229 </pre> </font></span></td>
230 <td valign="top">[[Main/WebNotify]]<p>[[Know/ReadmeFirst]]</p>
233 <tr bgcolor="#ffffff">
234 <td valign="top"><a name="SquareBrackets"></a> <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; for example, <code>[[text formatting FAQ]]</code> links to topic [[Main/TextFormattingFAQ]]. You can also refer to a different web and use anchors. </td>
235 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
239 </pre> </font></span></td>
240 <td valign="top">[[Main/WikiSyntax]]<p>[[Main/TWikiUsers]]</p>
243 <tr bgcolor="#ffffff">
244 <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 (e.g. [[Main/WikiSyntax]]) and external link references (e.g. <a href="http://TWiki.org/" target="_top">http://TWiki.org/</a>) are supported. %BR% <strong><em>Note:</em></strong> The same <strong><em>Forced Links</em></strong> rules apply for internal link references. %BR% <strong><em>Note:</em></strong> For external link references, you can simply use a space instead of <code>][</code> to separate the link URL from the descriptive text. %BR% <strong><em>Note:</em></strong> Anchor names can be added as well, like <code>[[WebHome#MyAnchor][go home]]</code> and <code>[[http://gnu.org/#Action][GNU Action]]</code>. </td>
245 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
246 [[WikiSyntax][syntax]]
248 [[http://gnu.org][GNU]]
250 [[http://xml.org XML]]
251 </pre> </font></span></td>
252 <td valign="top">[[Main/WikiSyntax]]<p><a href="http://gnu.org" target="_top">GNU</a></p>
253 <p><a href="http://xml.org" target="_top">XML</a></p>
256 <tr bgcolor="#ffffff">
257 <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>
258 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
264 </pre> </font></span></td>
265 <td valign="top">[[Main/WebHome#NotThere]]<p>[[Main/WebHome#MyAnchor]]</p>
266 <p><a name="MyAnchor"></a> To here </p>
269 <tr bgcolor="#ffffff">
270 <td valign="top"><strong>Prevent a Link:</strong> %BR% Prevent a [[Main/WikiWord]] from being linked by prepending it with the <code><nop></code> tag. </td>
271 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
273 </pre> </font></span></td>
274 <td valign="top"> SunOS </td>
276 <tr bgcolor="#ffffff">
277 <td valign="top"><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% <strong><em>Note:</em></strong> Each tag must be on a line by itself. %BR% <strong><em>Note:</em></strong> This also works for TWiki tables, but only if you add a blank line between the end of the table and the closing <code></noautolink></code> tag (known issue of the [[Main/TablePlugin]]). </td>
278 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
283 </pre> </font></span></td>
284 <td valign="top"> RedHat & SuSE </td>
286 <tr bgcolor="#ffffff">
287 <td valign="top"><strong>Mailto: Links:</strong> %BR% To create 'mailto:' links that have more descriptive link text, specify subject lines or message bodies, or omit the email address, you can write <code>[[mailto:user@domain descriptive text]]</code>. </td>
288 <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
289 [[mailto:a@z.com Mail]]
291 [[mailto:?subject=Hi Hi]]
292 </pre> </font></span></td>
293 <td valign="top"><a href="mailto:a@z.com">Mail</a><p><a href="mailto:?subject=Hi">Hi</a></p>
298 ## <a name="Using HTML"></a> Using HTML
300 You can use just about any HTML tag without a problem - however, there are a few usability and technical considerations to keep in mind.
302 ### <a name="HTML and TWiki Usability"></a> HTML and TWiki Usability
304 - On collaboration pages, it's preferable NOT to use HTML, and to use [[TWiki shorthand|Main/WebHome#TWikiShorthand]] instead - this keeps the text uncluttered and easy to edit.
305 - %X% **NOTE:** TWiki is designed to work with a wide range of browsers and computer platforms, holding to HTML 3.2 compatibility in the standard installation - adding raw HTML, particularly browser-specific tags (or any other mark-up that doesn't degrade well) will reduce compatibility.
307 ### <a name="TWiki HTML Rendering"></a> TWiki HTML Rendering
309 - TWiki converts shorthand notation to XHTML 1.0 for display. To copy a fully marked-up page, simply view source in your browser and save the contents.
310 - %T% If you need to save HTML frequently, you may want to check out TWiki:Plugins/GenHTMLAddon - it will "generate a directory containing rendered versions of a set of TWiki pages together with any attached files."
311 - %X% **NOTE:** The opening and closing angle brackets - <code>**<...>**</code> - of an HTML tag **_must be on the same line_**, or the tag will be broken.
312 - This feature allows you to enter an unclosed angle bracket - as a greater than or less than symbol - and have it automatically rendered as if you had entered its HTML character, `<`, ex: <code>**a > b**</code>
313 - %T% If you're pasting in preformatted HTML text and notice problems, check the file in a text processor with no text wrap. Also, save without hard line breaks on text wrap, in your HTML editing program.
315 ## <a name="Hyperlinks"></a> Hyperlinks
317 Being able to create links without any formatting required is a core TWiki feature, made possible with [[WikiWords]]. New TWiki linking rules are a simple extension of the syntax that provide a new set of flexible options.
319 ### <a name="Internal Links"></a> Internal Links
321 - [[GoodStyle]] is a [[WikiWord]] that links to the GoodStyle topic located in the current %WIKITOOLNAME% web.
323 - [[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!)
325 ### <a name="External Links"></a> External Links
327 - `http://...`, `https://...`, `ftp://...`, `gopher://...`, `news://...`, `file://...`, `telnet://...` and `mailto:...@...` are linked automatically.
329 - Email addresses like `name@domain.com` are linked automatically.
331 - `[[Square bracket rules]]` let you easily create [[non-WikiWord links|Main/WebHome#SquareBrackets]].
332 - 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/).
334 ## <a name="TWiki Variables"></a> TWiki Variables
336 Variables are names that are enclosed in percent signs `%` that are expanded on the fly.
338 - `%TOC%` : Automatically generates a table of contents based on headings in a topic - see the top of this page for an example.
340 - `%WEB%` : The current web, is **%WEB%**.
342 - `%TOPIC%` : The current topic name, is **%TOPIC%**.
344 - `%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.
346 - `%INCLUDE{"SomeTopic"}%` : Server side include, includes another topic. The current %WIKITOOLNAME% web is the default web. Example: <code>**%INCLUDE\{"TWiki.SiteMap"\}%**</code>
348 - `%SEARCH{"sushi"}%` : Inline search showing the search result embedded in a topic. [[FormattedSearch]] gives you control over formatting, used to create web-based applications.
350 - [[TWikiPreferences]] defines site-wide variables. Among others:
351 - **Line break:** Write <code><span><font>%BR%</font></span></code> to start a new line.
352 - **Colored text:** Write: <code><span><font> %RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors</font></span></code> to get: %RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors.
353 - **Documentation Graphics:** Write: <code><span><font> %H% Help, %T% Tip, %X% Alert</font></span></code> to get: %H% Help, %T% Tip, %X% Alert. For more info see [[TWikiDocGraphics]].
355 - There are many more variables, see **[[TWikiVariables]]**.
357 ## <a name="TWikiPlugin Formatting Extension"></a><a name="_TWikiPlugin Formatting Extensio"></a> TWikiPlugin Formatting Extensions
359 Plugins provide additional text formatting capabilities and can extend the functionality of %WIKITOOLNAME% into many other areas. For example, the optional [SpreadSheetPlugin](http://twiki.org/cgi-bin/view/Plugins/SpreadSheetPlugin) lets you create a spreadsheet with the same basic notation used in TWiki tables.
361 Available Plugins are located in the [Plugins](http://twiki.org/cgi-bin/view/Plugins) web on TWiki.org. Currently enabled plugins on this TWiki installation, as listed by `%PLUGINDESCRIPTIONS%`:
363 - [[SpreadSheetPlugin]] <span>(any TWiki, 10197)</span>:
364 - [[CommentPlugin]] <span>(Dakar, 11359)</span>: Allows users to quickly post comments to a page without an edit/preview/save cycle
365 - [[EditTablePlugin]] <span>(any TWiki, 11646)</span>:
366 - [[InterwikiPlugin]] <span>(Dakar, $Rev: 11935$)</span>:
367 - [[PreferencesPlugin]] <span>(Dakar, 9839)</span>:
368 - [[SlideShowPlugin]] <span>(Any TWiki, $Rev: 12847$)</span>:
369 - [[SmiliesPlugin]] <span>(Dakar, 8154)</span>:
370 - [[TablePlugin]] <span>(1.020, 12339)</span>:
371 - [[TwistyPlugin]] <span>(1.2.0, $Rev: 12154$)</span>:
373 Check on current Plugin status and settings for this site in [[TWikiPreferences]].
375 ## <a name="Common Editing Errors"></a> Common Editing Errors
377 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]]:
379 - **Q:** Text enclosed in angle brackets like `<filename>` is not displayed. How can I show it as it is?
380 - **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>'`.
382 - **Q:** Why is the `'&'` character sometimes not displayed?
383 - **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'`.
385 -- [[MikeMannix]] - 02 Dec 2001 <br /> -- [[PeterThoeny]] - 01 Feb 2003