Changes between Version 31 and Version 32 of MarkdownMacro


Ignore:
Timestamp:
May 28, 2021, 10:03:29 AM (3 years ago)
Author:
Cinc-th
Comment:

Added syntax description for some Markdown and Trac dialect

Legend:

Unmodified
Added
Removed
Modified
  • MarkdownMacro

    v31 v32  
    77This macro implements John Gruber's [http://daringfireball.net/projects/markdown/ Markdown] lightweight plain text-to-HTML formatting syntax as a [WikiProcessors wiki processor] macro.
    88
    9 Example of its usage:
     9Example of its [#usage usage]:
    1010
    1111{{{
     
    6565== Installation
    6666
    67 First you need to install the [pypi:Markdown Python Markdown] package.
    68 Follow the instructions on the Web site.
     67Easiest way is installation from source using PIP:
     68{{{
     69pip install https://trac-hacks.org/svn/markdownmacro/trunk
     70}}}
     71This takes care of the [pypi:Markdown Python Markdown] package which is automtically installed.
    6972
    7073General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page.
     
    8891exclusive and should not be both enabled.
    8992
     93== Usage
     94The 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
     96Some of Tracs syntax was added to Markdown so WikiProcessors, WikiMacros and ticket links can be used seamlessly.
     97
     98=== Basic usage
     99The macro can only be used as a [WikiProcessors WikiProcessor].
     100{{{
     101{{{#!Markdown
     102# A Header
     103
     104This is *all* Markdown.
     105}}}
     106}}}
     107
     108=== Links
     109
     110Since 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
     115This is [an example](http://example.com/foo#section "Title") inline link.
     116
     117Link defined with [an id][id] somewhere in the text.
     118
     119Implicit links work: [Bar link][]
     120
     121Autolink: <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}}}
     133For more visit the [http://daringfireball.net/projects/markdown/syntax Markdown syntax] page.
     134
     135=== Inline HTML
     136
     137HTML tags can be used whenever needed.
     138{{{
     139{{{#!Markdown
     140# A Header
     141
     142This 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
     153Because 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
     155Note 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
     167This 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
     182TracLinks are supported with the following syntax:
     183{{{
     184[Trac link specifier]
     185}}}
     186for example:
     187{{{
     188[ticket:2]
     189
     190[changeset:18323 Changest 18323]
     191}}}
     192Shortcut notations like {{{r18323}}} or {{{ticket:12000}}} are not working so alway add the brackets.
     193
     194=== Wiki links
     195
     196The Markdown [https://python-markdown.github.io/extensions/wikilinks/ WikiLinks syntax] is supported:
     197
     198{{{
     199A link to [[WikiStart]].
     200}}}
     201
     202In addition you may use TracLinks notation if you want to use another label.
     203{{{
     204Use 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
     212WikiProcessors can be used without any special escape syntax. Just add the processor to the Markdown text.
     213{{{
     214{{{#!Markdown
     215# A Header
     216
     217This is *all* Markdown but Trac WikiProcessors can be used:
     218
     219{{{#!python
     220def function():
     221    foo = 1
     222}}}
     223
     224{{{#!ini
     225[section]
     226foo = bar
     227}}}
     228
     229}}}
     230}}}
     231
     232=== Using !WikiMacros
     233
     234**Note:** this is a Trac addition
     235
     236Tracs WikiMacros can be used like with normal Trac wiki syntax.
     237
     238{{{
     239{{{#!Markdown
     240# A Header
     241
     242This is *all* Markdown but Trac WikiMacros can be used:
     243
     244[[TracIni()]]
     245
     246}}}
     247}}}
     248
    90249== Recent Changes
    91250