none
[openafs-wiki.git] / TWiki / TextFormattingRules.mdwn
index cd05a24..8a90054 100644 (file)
@@ -12,7 +12,9 @@
             <li><a href="#External Links"> External Links</a></li>
           </ul>
         </li>
+        <li><a href="#TWiki Variables"> TWiki Variables</a></li>
         <li><a href="#TWikiPlugin Formatting Extension"> TWikiPlugin Formatting Extensions</a></li>
+        <li><a href="#Common Editing Errors"> Common Editing Errors</a></li>
       </ul>
     </li>
   </ul>
@@ -43,7 +45,7 @@ Working in TWiki is as easy as typing in text - exactly like email. You don't ne
     </td>
   </tr>
   <tr bgcolor="#ffffff">
-    <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>
+    <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>
     <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 ---++ Sushi
 
@@ -230,7 +232,7 @@ Know.ReadmeFirst
     </td>
   </tr>
   <tr bgcolor="#ffffff">
-    <td valign="top">#SquareBrackets <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>
+    <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; i.e. <code>[[text formatting FAQ]]</code> links to topic [[Main/TextFormattingFAQ]]. You can also refer to a different web and use anchors. </td>
     <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 [[wiki syntax]]
 
@@ -270,12 +272,22 @@ Know.ReadmeFirst
     </td>
   </tr>
   <tr bgcolor="#ffffff">
-    <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>
+    <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>
     <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 &lt;nop&gt;SunOS
 </pre> </font></span></td>
     <td valign="top"> SunOS </td>
   </tr>
+  <tr bgcolor="#ffffff">
+    <td valign="top"><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% <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>&lt;/noautolink&gt;</code> tag (known issue of the [[Main/TablePlugin]]). </td>
+    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
+ &lt;noautolink&gt;
+ RedHat &amp;
+ SuSE
+ &lt;/noautolink&gt;
+</pre> </font></span></td>
+    <td valign="top"> RedHat &amp; SuSE </td>
+  </tr>
 </table>
 
 ## <a name="Using HTML"></a> Using HTML
@@ -314,6 +326,24 @@ Being able to create links without any formatting required is a core TWiki featu
 - `[[Square bracket rules]]` let you easily create [[non-WikiWord links|Main/WebHome#SquareBrackets]].
   - 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).
 
+## <a name="TWiki Variables"></a> TWiki Variables
+
+Variables are names that are enclosed in percent signs `%` that are expanded on the fly.
+
+- `%TOC%` : Automatically generates a table of contents based on headings in a topic - see the top of this page for an example.
+
+- `%WEB%` : The current web, is **%WEB%**.
+
+- `%TOPIC%` : The current topic name, is **%TOPIC%**.
+
+- `%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.
+
+- `%INCLUDE{"SomeTopic"}%` : Server side include, includes another topic. The current %WIKITOOLNAME% web is the default web. Example: <code>**%INCLUDE\{"TWiki.SiteMap"\}%**</code>
+
+- There are many more variables, see **[[TWikiVariables]]**.
+
+- [[TWikiPreferences]] defines site-wide variables like colors. For example, 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.
+
 ## <a name="TWikiPlugin Formatting Extension"></a><a name="_TWikiPlugin Formatting Extensio"></a> TWikiPlugin Formatting Extensions
 
 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.
@@ -332,12 +362,14 @@ Available Plugins are located in the [Plugins](http://twiki.org/cgi-bin/view/Plu
 
 Check on current Plugin status and settings for this site in [[TWikiPreferences]].
 
--- [[MikeMannix]] - 02 Dec 2001
+## <a name="Common Editing Errors"></a> Common Editing Errors
 
-Updated to cover TWiki:Codev/EasierExternalLinking (in the alpha release).
+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]]:
 
--- [[RichardDonkin]] - 26 Mar 2002
+- **Q:** Text enclosed in angle brackets like `<filename>` is not displayed. How can I show it as it is?
+  - **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>'`.
 
-Latest updates to this topic are in the main TWiki, since that's got the TWikiAlphaRelease code.
+- **Q:** Why is the `'&'` character sometimes not displayed?
+  - **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'`.
 
--- [[RichardDonkin]] - 05 Apr 2002
+-- [[MikeMannix]] - 02 Dec 2001 <br /> -- [[PeterThoeny]] - 02 May 2002