| 93 | == Usage |
| 94 | The general [http://daringfireball.net/projects/markdown/syntax Markdown syntax] is supported by the macro. In addition the [https://python-markdown.github.io/extensions/extra/ Markdown extra] extension is enabled which brings support for [https://python-markdown.github.io/extensions/tables/ tables], [https://python-markdown.github.io/extensions/footnotes/ footnotes] and more. |
| 95 | |
| 96 | Some of Tracs syntax was added to Markdown so WikiProcessors, WikiMacros and ticket links can be used seamlessly. |
| 97 | |
| 98 | === Basic usage |
| 99 | The macro can only be used as a [WikiProcessors WikiProcessor]. |
| 100 | {{{ |
| 101 | {{{#!Markdown |
| 102 | # A Header |
| 103 | |
| 104 | This is *all* Markdown. |
| 105 | }}} |
| 106 | }}} |
| 107 | |
| 108 | === Links |
| 109 | |
| 110 | Since the full [http://daringfireball.net/projects/markdown/syntax Markdown syntax] is implemented links can be specified in different ways. Using a link section in your Markdown text holding all references may be especially useful for structuring the content. |
| 111 | {{{ |
| 112 | {{{#!Markdown |
| 113 | # Using links |
| 114 | |
| 115 | This is [an example](http://example.com/foo#section "Title") inline link. |
| 116 | |
| 117 | Link defined with [an id][id] somewhere in the text. |
| 118 | |
| 119 | Implicit links work: [Bar link][] |
| 120 | |
| 121 | Autolink: <http://example.com/foo> |
| 122 | |
| 123 | ## Links below but not rendered |
| 124 | |
| 125 | [id]: <http://example.com/foo> "Foo Title Here" |
| 126 | |
| 127 | [foo]: http://example.com/foo "Foo Title Here" |
| 128 | |
| 129 | [Bar link]: http://example.com/bar "Bar Title Here" |
| 130 | |
| 131 | }}} |
| 132 | }}} |
| 133 | For more visit the [http://daringfireball.net/projects/markdown/syntax Markdown syntax] page. |
| 134 | |
| 135 | === Inline HTML |
| 136 | |
| 137 | HTML tags can be used whenever needed. |
| 138 | {{{ |
| 139 | {{{#!Markdown |
| 140 | # A Header |
| 141 | |
| 142 | This is *all* Markdown but HTML tags can be used when needed: |
| 143 | |
| 144 | <table> |
| 145 | <tr> |
| 146 | <td>Foo</td> |
| 147 | </tr> |
| 148 | </table> |
| 149 | |
| 150 | }}} |
| 151 | }}} |
| 152 | |
| 153 | Because the [https://python-markdown.github.io/extensions/md_in_html/ Markdown in HTML] extensions is enabled it is possible to wrap Markdown text in tags and still have the Markdown parsed. |
| 154 | |
| 155 | Note the attribute {{{markdown}}} in the following example. See [https://python-markdown.github.io/extensions/md_in_html/ Markdown in HTML] for possible values. |
| 156 | {{{ |
| 157 | {{{#!Markdown |
| 158 | # A Header |
| 159 | |
| 160 | <div style="border: 1px solid grey;" markdown="1"> |
| 161 | This is Markdown _text_ with *formatting*. |
| 162 | </div> |
| 163 | |
| 164 | }}} |
| 165 | }}} |
| 166 | |
| 167 | This can also be used with Trac features like WikiMacros: |
| 168 | {{{ |
| 169 | {{{#!Markdown |
| 170 | # A Header |
| 171 | |
| 172 | <div style="border: 1px solid grey;" markdown="1"> |
| 173 | [[TracIni()]] |
| 174 | </div> |
| 175 | |
| 176 | }}} |
| 177 | }}} |
| 178 | |
| 179 | === !TracLinks |
| 180 | **Note:** this is a Trac addition |
| 181 | |
| 182 | TracLinks are supported with the following syntax: |
| 183 | {{{ |
| 184 | [Trac link specifier] |
| 185 | }}} |
| 186 | for example: |
| 187 | {{{ |
| 188 | [ticket:2] |
| 189 | |
| 190 | [changeset:18323 Changest 18323] |
| 191 | }}} |
| 192 | Shortcut notations like {{{r18323}}} or {{{ticket:12000}}} are not working so alway add the brackets. |
| 193 | |
| 194 | === Wiki links |
| 195 | |
| 196 | The Markdown [https://python-markdown.github.io/extensions/wikilinks/ WikiLinks syntax] is supported: |
| 197 | |
| 198 | {{{ |
| 199 | A link to [[WikiStart]]. |
| 200 | }}} |
| 201 | |
| 202 | In addition you may use TracLinks notation if you want to use another label. |
| 203 | {{{ |
| 204 | Use TracLinks notation with [WikiStart Startpage]. |
| 205 | }}} |
| 206 | **Note:** the second variant is a Trac addition |
| 207 | |
| 208 | === Using !WikiProcessors |
| 209 | |
| 210 | **Note:** this is a Trac addition |
| 211 | |
| 212 | WikiProcessors can be used without any special escape syntax. Just add the processor to the Markdown text. |
| 213 | {{{ |
| 214 | {{{#!Markdown |
| 215 | # A Header |
| 216 | |
| 217 | This is *all* Markdown but Trac WikiProcessors can be used: |
| 218 | |
| 219 | {{{#!python |
| 220 | def function(): |
| 221 | foo = 1 |
| 222 | }}} |
| 223 | |
| 224 | {{{#!ini |
| 225 | [section] |
| 226 | foo = bar |
| 227 | }}} |
| 228 | |
| 229 | }}} |
| 230 | }}} |
| 231 | |
| 232 | === Using !WikiMacros |
| 233 | |
| 234 | **Note:** this is a Trac addition |
| 235 | |
| 236 | Tracs WikiMacros can be used like with normal Trac wiki syntax. |
| 237 | |
| 238 | {{{ |
| 239 | {{{#!Markdown |
| 240 | # A Header |
| 241 | |
| 242 | This is *all* Markdown but Trac WikiMacros can be used: |
| 243 | |
| 244 | [[TracIni()]] |
| 245 | |
| 246 | }}} |
| 247 | }}} |
| 248 | |