summaryrefslogtreecommitdiff
path: root/TWiki/TextFormattingRules.mdwn
blob: 481ba69739614570af6efd319edb05e01dc585b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
It is easy to collaborate; just type 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.

**LINKS**

The Collaborative Work Area is a bunch of related links that are editable through your web browser.

The %WIKITOOLNAME% web has the following types of **_internal links:_**

* [[GoodStyle]] is a [[WikiWord]] that links to the GoodStyle topic located in the current %WIKITOOLNAME% web.
* [[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!)

**_External links:_**

* `http://...`, `https://...`, `ftp://...` and `mailto:...@...` are linked automatically.
* Email addresses like `name@domain.com` are linked automatically.

**EDITING**

<table border="3" cellpadding="2" cellspacing="2">
  <tr>
    <td><strong>Formatting Command:</strong></td>
    <td><strong>Example: You write:</strong></td>
    <td><strong>You get:</strong></td>
  </tr>
  <tr>
    <td valign="top"><strong>Paragraphs:</strong><br /> Blank lines will create new paragraphs. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 1st paragraph

 2nd paragraph
</pre> </font></span></td>
    <td valign="top"> 1st paragraph <p> 2nd paragraph </p>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>Bold Text:</strong><br /> Words get <strong>bold</strong> by enclosing them in <code>*</code> asterisks. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 *Bold*
</pre> </font></span></td>
    <td valign="top"><strong>Bold</strong></td>
  </tr>
  <tr>
    <td valign="top"><strong>Italic Text:</strong><br /> Words get <em>italic</em> by enclosing them in <code>_</code> underscores. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 _Italic_
</pre> </font></span></td>
    <td valign="top"><em>Italic</em></td>
  </tr>
  <tr>
    <td valign="top"><strong>Bold Italic:</strong><br /> Words get <em>_bold italic</em> by enclosing them in <code>_</code> double-underscores. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 __Bold italic__
</pre> </font></span></td>
    <td valign="top"><strong><em>Bold italic</em></strong></td>
  </tr>
  <tr>
    <td valign="top"><strong>Fixed Font:</strong><br /> Words get shown in <code>fixed font</code> by enclosing them in <code><nop>=<nop></nop></nop></code> equal signs. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 =Fixed font=
</pre> </font></span></td>
    <td valign="top"><code>Fixed font</code></td>
  </tr>
  <tr>
    <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><nop></nop></b></code> double equal signs. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 ==Bold fixed==
</pre> </font></span></td>
    <td valign="top"><code><b>Bold fixed</b></code></td>
  </tr>
  <tr>
    <td valign="top"><strong><em>Note:</em></strong> Make sure to "stick" the <code>* _ = <nop>==<nop></nop></nop></code> signs to the words, e.g. take away spaces. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 _This works_,
 _this not _
</pre> </font></span></td>
    <td valign="top"><em>This works</em>, _this not _ </td>
  </tr>
  <tr>
    <td valign="top"><strong>Verbatim Mode:</strong><br /> Surround code excerpts and other formatted text with <code>&amp;lt;verbatim&amp;gt;</code> and <code>&amp;lt;/verbatim&amp;gt;</code> tags. <br /><strong><em>Note:</em></strong> Use <code>&amp;lt;pre&amp;gt;</code> and <code>&amp;lt;/pre&amp;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>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
&amp;lt;verbatim&amp;gt;
class CatAnimal {
  void purr() {
    &amp;lt;code here&amp;gt;
  }
}
&amp;lt;/verbatim&amp;gt;
</pre> </font></span></td>
    <td valign="top"><pre>
class CatAnimal {
  void purr() {
    &amp;lt;code here&amp;gt;
  }
}
</pre></td>
  </tr>
  <tr>
    <td valign="top"><strong>Separator:</strong><br /> At least four dashes at the beginning of a line. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
-------
</pre> </font></span></td>
    <td valign="top">
      <hr />
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>List Item:</strong><br /> Three spaces and an asterisk. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
   * bullet item
</pre> </font></span></td>
    <td valign="top">
      <ul>
        <li> bullet item </li>
      </ul>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>Nested List Item:</strong><br /> Six, nine, ... spaces and an asterisk. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
      * nested stuff
</pre> </font></span></td>
    <td valign="top">
      <ul>
        <li>
          <ul>
            <li> nested stuff </li>
          </ul>
        </li>
      </ul>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>Ordered List:</strong><br /> Three spaces and a number. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
   1 Sushi
   1 Dim Sum
</pre> </font></span></td>
    <td valign="top">
      <ol>
        <li> Sushi </li>
        <li> Dim Sum </li>
      </ol>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>Definition List:</strong><br /> Three spaces, the term, a colon, 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;amp;nbsp;</code> non-breaking-space entity. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
   Sushi: Japan
   Dim&amp;amp;nbsp;Sum: S.F.
</pre> </font></span></td>
    <td valign="top">
      <dl>
        <dt> Sushi</dt>
        <dd> Japan </dd>
        <dt> Dim Sum</dt>
        <dd> S.F. </dd>
      </dl>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong>Table:</strong><br /> Optional spaces followed by the cells enclosed in vertical bars. <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. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
| A1 | B1 | C1 |
| A2 | B2 | C2 |
| A3 \<nop>
  | next \<nop>
  | next |
</nop></nop></pre> </font></span></td>
    <td valign="top">
      <table border="1" cellpadding="1" cellspacing="0">
        <tr>
          <td> A1 </td>
          <td> B1 </td>
          <td> C1 </td>
        </tr>
        <tr>
          <td> A2 </td>
          <td> B2 </td>
          <td> C2 </td>
        </tr>
        <tr>
          <td> A3 </td>
          <td> next </td>
          <td> next </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top"><strong><nop>WikiWord Links:</nop></strong><br /><nop>CapitalizedWordsStuckTogether (or <span style="background:"><font color="">Wiki Words</font></span><a href="http://LOCATION/WikiWords">?</a>) 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>. </nop></td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 WebNotify,
 Know.ReadmeFirst
</pre> </font></span></td>
    <td valign="top"><span style="background:"><font color="">Web Notify</font></span><a href="http://LOCATION/WebNotify">?</a>, <span style="background:"><font color="">Readme First</font></span><a href="http://LOCATIONKnow/ReadmeFirst">?</a></td>
  </tr>
  <tr>
    <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>[<nop>[text formatting FAQ]]</nop></code> links to topic <span style="background:"><font color="">Text Formatting FAQ</font></span><a href="http://LOCATION/TextFormattingFAQ">?</a>. You can also refer to a different web. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 [[wiki syntax]],
 [[%MAINWEB%.TWiki users]]
</pre> </font></span></td>
    <td valign="top"><span style="background:"><font color="">wiki syntax</font></span><a href="http://LOCATION/WikiSyntax">?</a>, <span style="background:"><font color="">%MAINWEB%.TWiki users</font></span><a href="http://LOCATION/MAINWEBTWikiUsers">?</a></td>
  </tr>
  <tr>
    <td valign="top"><strong>Prevent a Link:</strong><br /> Prevent a <span style="background:"><font color="">Wiki Word</font></span><a href="http://LOCATION/WikiWord">?</a> from being linked by prepending it with the <code>&amp;lt;nop&amp;gt;</code> tag. </td>
    <td valign="top"><span style="background: #FFFFCC"><font color="#990000"> <pre>
 &amp;lt;nop&amp;gt;SunOS
</pre> </font></span></td>
    <td valign="top"><nop>SunOS </nop></td>
  </tr>
</table>

**HTML**

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.

* Overview of all HTML elements at <http://www.htmlhelp.com/reference/wilbur/overview.html>
* HTML 3.2 Reference Specification at <http://www.w3.org/TR/REC-html32.html>

**WIKI VARIABLES**

Variables are names that are enclosed in percent signs; they get expanded on the fly.

* <code>%WEB%</code> : The current web, is **%WEB%** .
* <code>%TOPIC%</code> : The current topic name, is **%TOPIC%** .
* <code>%ATTACHURL%</code> : 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.
* <code>%INCLUDE\{"SomeTopic"\}%</code> : Server side include, includes another topic. The current %WIKITOOLNAME% web is the default web. Example: <code>**%INCLUDE\{"%TWIKIWEB%.TWikiWebsTable"\}%**</code>
* There are many more variables, see [[TWikiVariables]].