PageRenderTime 51ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/defaults/help/TracWikiSyntax.md

https://bitbucket.org/wez/mtrack/
Markdown | 479 lines | 364 code | 115 blank | 0 comment | 0 complexity | 607c8c30885c2fd329bfa5d39721e1c0 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0
  1. ```trac
  2. = Trac Wiki Syntax =
  3. ''Note: Trac Wiki Syntax exists in a legacy capacity for older installations
  4. of mtrack. New installs use a variation on Markdown which is documented in [help:WikiFormatting].''
  5. Wiki markup is a core feature, tightly integrating all the other parts of mtrack into a flexible and powerful whole.
  6. mtrack 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,
  7. especially [http://moinmo.in MoinMoin].
  8. This page demonstrates the formatting syntax available anywhere !WikiFormatting is allowed.
  9. == Font Styles ==
  10. The Trac wiki supports the following font styles:
  11. {{{
  12. * '''bold''', '''!''' can be bold too''', and '''! '''
  13. * ''italic''
  14. * '''''bold italic'''''
  15. * __underline__
  16. * {{{monospace}}} or `monospace`
  17. * ~~strike-through~~
  18. * ^superscript^
  19. * ,,subscript,,
  20. }}}
  21. Display:
  22. * '''bold''', '''!''' can be bold too''', and '''! '''
  23. * ''italic''
  24. * '''''bold italic'''''
  25. * __underline__
  26. * {{{monospace}}} or `monospace`
  27. * ~~strike-through~~
  28. * ^superscript^
  29. * ,,subscript,,
  30. Notes:
  31. * `{{{...}}}` and {{{`...`}}} 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.
  32. * {{{ ! }}} tells wiki parser to not take the following characters as wiki format, so pay attention to put a space after !, e.g. when ending bold.
  33. == Headings ==
  34. You can create heading by starting a line with one up to five ''equal'' characters ("=")
  35. followed by a single space and the headline text. The line should end with a space
  36. followed by the same number of ''='' characters.
  37. The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
  38. Example:
  39. {{{
  40. = Heading =
  41. == Subheading ==
  42. === About ''this'' ===
  43. === Explicit id === #using-explicit-id-in-heading
  44. }}}
  45. Display:
  46. = Heading =
  47. == Subheading ==
  48. === About ''this'' ===
  49. === Explicit id === #using-explicit-id-in-heading
  50. == Paragraphs ==
  51. A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
  52. A forced line break can also be inserted, using:
  53. {{{
  54. Line 1[[BR]]Line 2
  55. }}}
  56. Display:
  57. Line 1[[BR]]Line 2
  58. == Lists ==
  59. The wiki supports both ordered/numbered and unordered lists.
  60. Example:
  61. {{{
  62. * Item 1
  63. * Item 1.1
  64. * Item 1.1.1
  65. * Item 1.1.2
  66. * Item 1.1.3
  67. * Item 1.2
  68. * Item 2
  69. 1. Item 1
  70. a. Item 1.a
  71. a. Item 1.b
  72. i. Item 1.b.i
  73. i. Item 1.b.ii
  74. 1. Item 2
  75. And numbered lists can also be given an explicit number:
  76. 3. Item 3
  77. }}}
  78. Display:
  79. * Item 1
  80. * Item 1.1
  81. * Item 1.1.1
  82. * Item 1.1.2
  83. * Item 1.1.3
  84. * Item 1.2
  85. * Item 2
  86. 1. Item 1
  87. a. Item 1.a
  88. a. Item 1.b
  89. i. Item 1.b.i
  90. i. Item 1.b.ii
  91. 1. Item 2
  92. And numbered lists can also be given an explicit number:
  93. 3. Item 3
  94. Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
  95. == Definition Lists ==
  96. The wiki also supports definition lists.
  97. Example:
  98. {{{
  99. llama::
  100. some kind of mammal, with hair
  101. ppython::
  102. some kind of reptile, without hair
  103. (can you spot the typo?)
  104. }}}
  105. Display:
  106. llama::
  107. some kind of mammal, with hair
  108. ppython::
  109. some kind of reptile, without hair
  110. (can you spot the typo?)
  111. Note that you need a space in front of the defined term.
  112. == Preformatted Text ==
  113. Block containing preformatted text are suitable for source code snippets, notes and examples. Use three ''curly braces'' wrapped around the text to define a block quote. The curly braces need to be on a separate line.
  114. Example:
  115. {{{
  116. {{{
  117. def HelloWorld():
  118. print "Hello World"
  119. }}}
  120. }}}
  121. Display:
  122. {{{
  123. def HelloWorld():
  124. print "Hello World"
  125. }}}
  126. == Blockquotes ==
  127. In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
  128. Example:
  129. {{{
  130. This text is a quote from someone else.
  131. }}}
  132. Display:
  133. This text is a quote from someone else.
  134. == Discussion Citations ==
  135. To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used.
  136. Example:
  137. {{{
  138. >> Someone's original text
  139. > Someone else's reply text
  140. My reply text
  141. }}}
  142. Display:
  143. >> Someone's original text
  144. > Someone else's reply text
  145. My reply text
  146. ''Note: Some !WikiFormatting elements, such as lists and preformatted text, are lost in the citation area. Some reformatting may be necessary to create a clear citation.''
  147. == Tables ==
  148. Simple tables can be created like this:
  149. {{{
  150. ||Cell 1||Cell 2||Cell 3||
  151. ||Cell 4||Cell 5||Cell 6||
  152. }}}
  153. Display:
  154. ||Cell 1||Cell 2||Cell 3||
  155. ||Cell 4||Cell 5||Cell 6||
  156. == Links ==
  157. Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
  158. Example:
  159. {{{
  160. TitleIndex, http://www.edgewall.com/, !NotAlink
  161. }}}
  162. Display:
  163. TitleIndex, http://www.edgewall.com/, !NotAlink
  164. Links 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 discarded, unless the link is an external link. This can be useful for wiki pages not adhering to the WikiPageNames convention.
  165. Example:
  166. {{{
  167. * [http://www.edgewall.com/ Edgewall Software]
  168. * [wiki:TitleIndex Title Index]
  169. * [wiki:ISO9000]
  170. }}}
  171. Display:
  172. * [http://www.edgewall.com/ Edgewall Software]
  173. * [wiki:TitleIndex Title Index]
  174. * [wiki:ISO9000]
  175. == Trac Links ==
  176. Wiki 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:
  177. {{{
  178. * Tickets: #1 or ticket:1
  179. * Reports: {1} or report:1
  180. * Changesets: r1, [1] or changeset:1
  181. * Milestones: milestone:1
  182. * Help: help:WikiFormatting
  183. * Users: user:wez
  184. * ...
  185. }}}
  186. Display:
  187. * Tickets: #1 or ticket:1
  188. * Reports: {1} or report:1
  189. * Changesets: r1, [1] or changeset:1
  190. * Milestones: milestone:1
  191. * Help: help:WikiFormatting
  192. * Users: user:wez
  193. * ...
  194. There are many more flavors of Trac links, see TracLinks for more in-depth information.
  195. == Escaping Links and WikiPageNames ==
  196. You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
  197. Example:
  198. {{{
  199. !NoHyperLink
  200. !#42 is not a link
  201. }}}
  202. Display:
  203. !NoHyperLink
  204. !#42 is not a link
  205. == Images ==
  206. The simplest way to include an image is to upload it as an attachment to the current page, and put the filename in a macro call like `[[Image(picture.gif)]]`.
  207. In addition to the current page, it is possible to refer to other resources:
  208. * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page)
  209. * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket)
  210. Other parameters:
  211. * `[[Image(photo.jpg,200px)]]` (scale picture to be 200px wide)
  212. * `[[Image(photo.jpg,200px,nolink)]]` (don't generate a link to picture)
  213. * `[[Image(photo.jpg,200px,right)]]` (float image to right)
  214. * `[[Image(photo.jpg,width=200,height=300)]]` (explicitly set size)
  215. * `[[Image(photo.jpg,name=value,other=otherval)]]` (set arbitrary attributes on the IMG tag. Values are HTML escaped)
  216. {{{
  217. #!comment
  218. == Macros ==
  219. Macros are ''custom functions'' to insert dynamic content in a page.
  220. Example:
  221. {{{
  222. [[RecentChanges(Trac,3)]]
  223. }}}
  224. Display:
  225. [[RecentChanges(Trac,3)]]
  226. See WikiMacros for more information, and a list of installed macros.
  227. }}}
  228. == Processors ==
  229. Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in HTML.
  230. === HTML ===
  231. {{{
  232. #!html
  233. <pre class="wiki">{{{
  234. #!html
  235. &lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
  236. }}}</pre>
  237. }}}
  238. Display:
  239. {{{
  240. #!html
  241. <h1 style="text-align: right; color: blue">HTML Test</h1>
  242. }}}
  243. === Python ===
  244. {{{
  245. #!html
  246. <pre class="wiki">{{{
  247. #!python
  248. class Test:
  249. def __init__(self):
  250. print "Hello World"
  251. if __name__ == '__main__':
  252. Test()
  253. }}}</pre>
  254. }}}
  255. Display:
  256. {{{
  257. #!python
  258. class Test:
  259. def __init__(self):
  260. print "Hello World"
  261. if __name__ == '__main__':
  262. Test()
  263. }}}
  264. === Perl ===
  265. {{{
  266. #!html
  267. <pre class="wiki">{{{
  268. #!perl
  269. my ($test) = 0;
  270. if ($test > 0) {
  271. print "hello";
  272. }
  273. }}}</pre>
  274. }}}
  275. {{{
  276. #!perl
  277. my ($test) = 0;
  278. if ($test > 0) {
  279. print "hello";
  280. }
  281. }}}
  282. === Markdown ===
  283. mtrack has a markdown processor that can be used as shown below. In addition
  284. to supporting the
  285. [http://michelf.com/projects/php-markdown/extra/ Markdown Extra] flavor
  286. of Markdown, this implementation supports mtrack style links as both reference
  287. and inline links, and supports all of the mtrack wiki processors in
  288. [http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks fenced blocks].
  289. {{{
  290. #!html
  291. <pre class="wiki">{{{
  292. #!markdown
  293. # Markdown title
  294. This is some markdown text
  295. }}}</pre>
  296. }}}
  297. Displays:
  298. {{{
  299. #!markdown
  300. # Markdown title
  301. This is some markdown text
  302. }}}
  303. == Diagrams with ASCIIToSVG ==
  304. mtrack includes [https://bitbucket.org/dhobsd/asciitosvg ASCIIToSVG], an ASCII art diagram to SVG translator. This is nice if you're writing technical documentation and want to have some diagrams inlined.
  305. Here's a brief example:
  306. {{{
  307. #!html
  308. <pre class="wiki">{{{
  309. #!a2s
  310. .-------------. .--------------.
  311. |[Red Box] |->|[Blue Box] |
  312. '-------------' '--------------'
  313. [Red Box]: {"fill":"#aa4444"}
  314. [Blue Box]: {"fill":"#ccccff"}
  315. }}}</pre>
  316. }}}
  317. {{{
  318. #!a2s
  319. .-------------. .--------------.
  320. |[Red Box] |->|[Blue Box] |
  321. '-------------' '--------------'
  322. [Red Box]: {"fill":"#aa4444"}
  323. [Blue Box]: {"fill":"#ccccff"}
  324. }}}
  325. == Comments ==
  326. Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
  327. {{{
  328. {{{
  329. #!comment
  330. Your comment here
  331. }}}
  332. }}}
  333. == Data output from SQL command line utilities ==
  334. If you have text that you want to copy and paste from a command line utility,
  335. such as psql, then you can enclose it in the ''dataset'' processor:
  336. {{{
  337. {{{
  338. #!dataset
  339. current_query | procpid | usename | client_addr | elapsed
  340. --------------------------------------+---------+---------+--------------+-----------------
  341. SELECT * FROM build_mailing(59508) | 6595 | user | 10.16.40.80 | 00:04:24.377262
  342. FETCH NEXT FROM "<unnamed portal 5>" | 27597 | user | 10.16.40.80 | 00:00:44.208982
  343. commit | 19188 | user | 10.16.40.67 | 00:00:00.013402
  344. COMMIT | 26390 | user | 10.16.1.56 | 00:00:00.007778
  345. }}}
  346. }}}
  347. {{{
  348. #!dataset
  349. current_query | procpid | usename | client_addr | elapsed
  350. --------------------------------------+---------+---------+--------------+-----------------
  351. SELECT * FROM build_mailing(59508) | 6595 | user | 10.16.40.80 | 00:04:24.377262
  352. FETCH NEXT FROM "<unnamed portal 5>" | 27597 | user | 10.16.40.80 | 00:00:44.208982
  353. commit | 19188 | user | 10.16.40.67 | 00:00:00.013402
  354. COMMIT | 26390 | user | 10.16.1.56 | 00:00:00.007778
  355. }}}
  356. == Miscellaneous ==
  357. Four or more dashes will be replaced by a horizontal line (<HR>)
  358. Example:
  359. {{{
  360. ----
  361. }}}
  362. Display:
  363. ----
  364. ```