Edgewall Software

Ticket #2296: WikiFormatting.tex

File WikiFormatting.tex, 11.4 KB (added by Trent Apted <tapted@…>, 3 years ago)

Result of trunk/wiki-default/WikiFormatting (LaTeX)

Line 
1\documentclass{article}
2\usepackage{url}
3\usepackage{ulem}
4\usepackage[pagebackref, bookmarks, pdfpagelabels,
5    citecolor=black, linkcolor=black, anchorcolor=blue, filecolor=black,
6    bookmarksopen=true, plainpages=false, colorlinks=true, bookmarksnumbered=true,
7    pdftitle={WikiFormatting},
8    pdfauthor={userid}]{hyperref}
9\newcommand{\anchortext}[1]{\def\ULthickness{.2pt}\underbar{#1}\def\ULthickness{.4pt}} %this does not appear to work properly
10\newcommand{\mypercent}{\%{}}
11\newcommand{\myamp}{\&{}}
12\setlength\parskip{\medskipamount}
13\setlength\parindent{0pt}
14\begin{document}
15\section{\label{sub:WikiFormatting}WikiFormatting}
16
17\subsection{\label{anchor:WikiFormatting}WikiFormatting}
18
19
20
21Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole.
22
23
24Trac has a built in small and powerful wiki rendering engine. This wiki engine implements an ever growing subset of the commands from other popular Wikis,
25especially \anchortext{MoinMoin}\footnote{\url{http://moinmoin.wikiwikiweb.de/}}.
26
27
28This page demonstrates the formatting syntax available anywhere \anchortext{WikiFormatting} (\S\ref{sub:WikiFormatting}) is allowed.
29
30
31\subsubsection{\label{anchor:Font-Styles}Font Styles}
32
33
34The Trac wiki supports the following font styles:
35\begin{verbatim}
36 * '''bold'''
37 * ''italic''
38 * '''''bold italic'''''
39 * __underline__
40 * {{{monospace}}} or `monospace`
41 * ~~strike-through~~
42 * ^superscript^ 
43 * ,,subscript,,
44\end{verbatim}
45
46
47Display:
48
49\begin{itemize}
50\item \textbf{bold}
51\item \textit{italic}
52\item \textbf{\bfseries\itshape bold italic}
53\item \underbar{underline}
54\item \texttt{monospace} or \texttt{monospace}
55\item \sout{strike-through}
56\item $^{superscript}$ 
57\item $_{subscript}$
58\end{itemize}
59
60Note that the \texttt{{{{...}}}} and \texttt{`...`} commands not only select a monospace font, but also treat their content as verbatim text, meaning that no further wiki processing is done on this text.
61
62
63\subsubsection{\label{anchor:Headings}Headings}
64
65
66You can create heading by starting a line with one up to five \textit{equal} characters (``='')
67followed by a single space and the headline text. The line should end with a space
68followed by the same number of \textit{=} characters.
69
70
71Example:
72\begin{verbatim}
73= Heading =
74== Subheading ==
75=== About ''this'' ===
76\end{verbatim}
77
78
79Display:
80
81
82\subsection{\label{anchor:Heading}Heading}
83
84
85\subsubsection{\label{anchor:Subheading}Subheading}
86
87
88\subsubsection*{\label{anchor:About-this}About ''this''}
89
90
91\subsubsection{\label{anchor:Paragraphs}Paragraphs}
92
93
94A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
95
96
97A forced line break can also be inserted, using:
98\begin{verbatim}
99Line 1[[BR]]Line 2
100\end{verbatim}
101Display:
102
103
104Line 1\\Line 2
105
106
107\subsubsection{\label{anchor:Lists}Lists}
108
109
110The wiki supports both ordered/numbered and unordered lists.
111
112
113Example:
114\begin{verbatim}
115 * Item 1
116   * Item 1.1
117 * Item 2
118
119 1. Item 1
120   1. Item 1.1
121 1. Item 2
122\end{verbatim}
123
124
125Display:
126
127\begin{itemize}
128\item Item 1
129\begin{itemize}
130\item Item 1.1
131\end{itemize}
132\item Item 2
133\end{itemize}
134\begin{enumerate}
135\item Item 1
136\begin{enumerate}
137\item Item 1.1
138\end{enumerate}
139\item Item 2
140\end{enumerate}
141
142Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
143
144
145\subsubsection{\label{anchor:Definition-Lists}Definition Lists}
146
147
148The wiki also supports definition lists.
149
150
151Example:
152\begin{verbatim}
153 llama::
154   some kind of mammal, with hair
155 ppython::
156   some kind of reptile, without hair
157   (can you spot the typo?)
158\end{verbatim}
159
160
161Display:
162\begin{description}
163\item[llama] 
164some kind of mammal, with hair
165\item[ppython] 
166some kind of reptile, without hair
167(can you spot the typo?)
168
169\end{description}
170
171Note that you need a space in front of the defined term.
172
173
174\subsubsection{\label{anchor:Preformatted-Text}Preformatted Text}
175
176
177Block containing preformatted text are suitable for source code snippets, notes and examples. Use three \textit{curly braces} wrapped around the text to define a block quote. The curly braces need to be on a separate line.
178 
179Example:
180\begin{verbatim}
181 {{{
182  def HelloWorld():
183      print "Hello World"
184 }}}
185\end{verbatim}
186
187
188Display:
189\begin{verbatim}
190 def HelloWorld():
191     print "Hello World"
192\end{verbatim}
193
194
195\subsubsection{\label{anchor:Blockquotes}Blockquotes}
196
197
198In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
199
200
201Example:
202\begin{verbatim}
203  This text is a quote from someone else.
204\end{verbatim}
205
206
207Display:
208
209\begin{quote}
210
211This text is a quote from someone else.
212
213\end{quote}
214
215\subsubsection{\label{anchor:Tables}Tables}
216
217
218Simple tables can be created like this:
219\begin{verbatim}
220||Cell 1||Cell 2||Cell 3||
221||Cell 4||Cell 5||Cell 6||
222\end{verbatim}
223
224
225Display:
226
227\begin{tabular}{|l|l|l|l|l|l|l|l|l|} \hline
228
229Cell 1 & Cell 2 & Cell 3
230~\\ \hline
231
232Cell 4 & Cell 5 & Cell 6
233~\\ \hline
234\end{tabular}
235
236Note that more complex tables can be created using
237\anchortext{reStructuredText} (\S\ref{sub:WikiRestructuredText:BiggerReSTExample})\footnote{\url{wiki:WikiRestructuredText\#{}BiggerReSTExample}}.
238
239
240\subsubsection{\label{anchor:Links}Links}
241
242
243Hyperlinks are automatically created for \anchortext{WikiPageNames} (\S\ref{sub:WikiPageNames}) and URLs. WikiPageLinks can be disabled by prepending an exclamation mark ``!'' character, such as \texttt{!WikiPageLink}.
244
245
246Example:
247\begin{verbatim}
248 TitleIndex, http://www.edgewall.com/, !NotAlink
249\end{verbatim}
250
251
252Display:
253
254\begin{quote}
255
256\anchortext{TitleIndex} (\S\ref{sub:TitleIndex}), \url{http:http://www.edgewall.com/}, NotAlink
257
258\end{quote}
259
260Links can be given a more descriptive title by writing the link followed by a space and a title and all this inside square brackets.  If the descriptive title is omitted, then the explicit prefix is disguarded, unless the link is an external link. This can be useful for wiki pages not adhering to the \anchortext{WikiPageNames} (\S\ref{sub:WikiPageNames}) convention.
261
262
263Example:
264\begin{verbatim}
265 * [http://www.edgewall.com/ Edgewall Software]
266 * [wiki:TitleIndex Title Index]
267 * [wiki:ISO9000]
268\end{verbatim}
269
270
271Display:
272
273\begin{itemize}
274\item \anchortext{Edgewall Software}\footnote{\url{http://www.edgewall.com/}}
275\item \anchortext{Title Index} (\S\ref{sub:TitleIndex})\footnote{\url{wiki:TitleIndex}}
276\item \anchortext{ISO9000} (\S\ref{sub:ISO9000})
277\end{itemize}
278
279\subsubsection*{\label{anchor:Trac-Links}Trac Links}
280
281
282Wiki pages can link directly to other parts of the Trac system. Pages can refer to tickets, reports, changesets, milestones, source files and other Wiki pages using the following notations:
283\begin{verbatim}
284 * Tickets: #1 or ticket:1
285 * Reports: {1} or report:1
286 * Changesets: r1, [1] or changeset:1
287 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
288 * Wiki pages: CamelCase or wiki:CamelCase
289 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
290 * Files: source:trunk/COPYING
291 * Attachments: attachment:"file name.doc"
292 * A specific file revision: source:/trunk/COPYING#200
293 * A filename with embedded space: source:"/trunk/README FIRST"
294\end{verbatim}
295
296
297Display:
298
299\begin{itemize}
300\item \textless Bad Unicode on this line \textgreater
301\item \textless Bad Unicode on this line \textgreater
302\item Changesets: \anchortext{r1} (\S\ref{sub:r1}), \textless{}a class=``changeset'' title=``Iniitla improt
303
304'' href=``/tracsvn/changeset/1``\textgreater{}[1]\textless{}/a\textgreater{} or \anchortext{changeset:1} (\S\ref{sub:changeset:1})
305\item \textless Bad Unicode on this line \textgreater
306\item Wiki pages: \anchortext{CamelCase} (\S\ref{sub:CamelCase}) or \anchortext{wiki:CamelCase} (\S\ref{sub:wiki:CamelCase})
307\item Milestones: \anchortext{milestone:1.0} (\S\ref{sub:milestone:1.0}) or \anchortext{milestone:``End-of-days Release''} (\S\ref{sub:milestone:End-of-days-Release})
308\item Files: \anchortext{source:trunk/COPYING} (\S\ref{sub:source:trunk/COPYING})
309\item Attachments: \anchortext{attachment:``file name.doc''} (\S\ref{sub:attachment:file-name.doc})
310\item A specific file revision: \anchortext{source:/trunk/COPYING\#{}200} (\S\ref{sub:source:/trunk/COPYING:200})
311\item A filename with embedded space: \anchortext{source:``/trunk/README FIRST''} (\S\ref{sub:source:/trunk/README-FIRST})
312\end{itemize}
313
314See \anchortext{TracLinks} (\S\ref{sub:TracLinks}) for more in-depth information.
315
316
317\subsubsection{\label{anchor:Escaping-Links-and-WikiPageNames}Escaping Links and WikiPageNames}
318
319
320You may avoid making hyperlinks out of \anchortext{TracLinks} (\S\ref{sub:TracLinks}) by preceding an expression with a single ``!'' (exclamation mark).
321
322
323Example:
324\begin{verbatim}
325 !NoHyperLink
326 !#42 is not a link
327\end{verbatim}
328
329
330Display:
331
332\begin{quote}
333
334NoHyperLink
335\#{}42 is not a link
336
337\end{quote}
338
339\subsubsection{\label{anchor:Images}Images}
340
341
342Urls ending with \texttt{.png}, \texttt{.gif} or \texttt{.jpg} are automatically interpreted as image links, and converted to \texttt{\textless{}img\textgreater{}} tags.
343
344
345Example:
346\begin{verbatim}
347http://www.edgewall.com/gfx/trac_example_image.png
348\end{verbatim}
349
350
351Display:
352
353
354\url{http:http://www.edgewall.com/gfx/trac\_{}example\_{}image.png}
355
356
357However, this doesn't give much control over the display mode. This way of inserting images is deprecated in favor of the more powerful \texttt{Image} macro (see \anchortext{WikiMacros} (\S\ref{sub:WikiMacros})).
358
359
360\subsubsection{\label{anchor:Macros}Macros}
361
362
363Macros are \textit{custom functions} to insert dynamic content in a page.
364
365
366Example:
367\begin{verbatim}
368 [[Timestamp]]
369\end{verbatim}
370
371
372Display:
373
374\begin{quote}
375
376\begin{verbatim}
377<b>Wed 10 May 2006 15:32:21 EST</b>
378\end{verbatim}
379
380
381\end{quote}
382
383See \anchortext{WikiMacros} (\S\ref{sub:WikiMacros}) for more information, and a list of installed macros.
384
385
386\subsubsection{\label{anchor:Processors}Processors}
387
388
389Trac supports alternative markup formats using \anchortext{WikiProcessors} (\S\ref{sub:WikiProcessors}). For example, processors are used to write pages in
390\anchortext{reStructuredText} (\S\ref{sub:WikiRestructuredText})\footnote{\url{wiki:WikiRestructuredText}} or \anchortext{HTML} (\S\ref{sub:WikiHtml})\footnote{\url{wiki:WikiHtml}}.
391
392
393Example 1:
394\begin{verbatim}
395#!html
396<pre class="wiki">{{{
397#!html
398&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
399}}}</pre>
400\end{verbatim}
401
402
403Display:
404\begin{verbatim}
405#!html
406<h1 style="text-align: right; color: blue">HTML Test</h1>
407\end{verbatim}
408
409
410Example:
411\begin{verbatim}
412#!html
413<pre class="wiki">{{{
414#!python
415class Test:
416    def __init__(self):
417        print "Hello World"
418if __name__ == '__main__':
419   Test()
420}}}</pre>
421\end{verbatim}
422
423
424Display:
425\begin{verbatim}
426#!python
427class Test:
428    def __init__(self):
429        print "Hello World"
430if __name__ == '__main__':
431   Test()
432\end{verbatim}
433
434
435Perl:
436\begin{verbatim}
437#!perl
438my ($test) = 0;
439if ($test > 0) {
440echo "hello";
441}
442\end{verbatim}
443
444
445See \anchortext{WikiProcessors} (\S\ref{sub:WikiProcessors}) for more information.
446
447
448\subsubsection{\label{anchor:Miscellaneous}Miscellaneous}
449
450
451Four or more dashes will be replaced by a horizontal line (\textless{}HR\textgreater{})
452
453
454Example:
455\begin{verbatim}
456 ----
457\end{verbatim}
458
459
460Display:
461
462{\normalsize \vspace{1ex} \hrule width \columnwidth \vspace{1ex}}
463{\normalsize \vspace{1ex} \hrule width \columnwidth \vspace{1ex}}
464
465See also: \anchortext{TracLinks} (\S\ref{sub:TracLinks}), \anchortext{TracGuide} (\S\ref{sub:TracGuide}), \anchortext{WikiHtml} (\S\ref{sub:WikiHtml}), \anchortext{WikiMacros} (\S\ref{sub:WikiMacros}), \anchortext{WikiProcessors} (\S\ref{sub:WikiProcessors}), \anchortext{TracSyntaxColoring} (\S\ref{sub:TracSyntaxColoring}).
466
467\end{document}