Edgewall Software

Changes between Version 39 and Version 40 of WikiMacros


Ignore:
Timestamp:
May 11, 2011, 10:51:18 AM (13 years ago)
Author:
Christian Boos
Comment:

don't use [[MacroList]] here, rather use content matching version 0.12 (taken from babel.e.o)

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v39 v40  
    1 ** Note: this page documents the 0.12 version of Trac, see [[0.11/WikiMacros]] if you need the previous version **
     1** Note: this page documents the 0.12 version of Trac, see [[0.11/WikiMacros]] if you need the previous version and [[0.13/WikiMacros]] if you need the next version**
    22= Trac Macros =
    33
     
    5555<h3><code>[[Image]]</code></h3>Embed an image in wiki-formatted text.
    5656
    57 The first argument is the file
     57The first argument is the file …
    5858<h3><code>[[InterTrac]]</code></h3>Provide a list of known <a class="wiki" href="/wiki/InterTrac">InterTrac</a> prefixes.
    5959<h3><code>[[InterWiki]]</code></h3>Provide a description list for the known <a class="wiki" href="/wiki/InterWiki">InterWiki</a> prefixes.
    6060<h3><code>[[KnownMimeTypes]]</code></h3>List all known mime-types which can be used as <a class="wiki" href="/wiki/WikiProcessors">WikiProcessors</a>.
    61 Can be </div>
     61Can be …</div>
    6262}}}
    6363etc.
     
    6868''Note that the following list will only contain the macro documentation if you've not enabled `-OO` optimizations, or not set the `PythonOptimize` option for [wiki:TracModPython mod_python].''
    6969
    70 [[MacroList]]
     70(the following is snapshot for Trac 0.12.2 - see [[0.13/WikiMacros]] for the documentation of macros in trunk / 0.13dev)
     71{{{#!html
     72<div class="trac-macrolist"><h3 id="Image-macro"><code>[[Image]]</code></h3><p>
     73Embed an image in wiki-formatted text.
     74</p>
     75<p>
     76The first argument is the file specification. The file specification may
     77reference attachments in three ways:
     78</p>
     79<ul><li><tt>module:id:file</tt>, where module can be either <strong>wiki</strong> or <strong>ticket</strong>,
     80to refer to the attachment named <em>file</em> of the specified wiki page or
     81ticket.
     82</li><li><tt>id:file</tt>: same as above, but id is either a ticket shorthand or a Wiki
     83page name.
     84</li><li><tt>file</tt> to refer to a local attachment named 'file'. This only works from
     85within that wiki page or a ticket.
     86</li></ul><p>
     87Also, the file specification may refer to repository files, using the
     88<tt>source:file</tt> syntax (<tt>source:file@rev</tt> works also).
     89</p>
     90<p>
     91Files can also be accessed with a direct URLs; <tt>/file</tt> for a
     92project-relative, <tt>//file</tt> for a server-relative, or <tt>http://server/file</tt>
     93for absolute location of the file.
     94</p>
     95<p>
     96The remaining arguments are optional and allow configuring the attributes
     97and style of the rendered <tt>&lt;img&gt;</tt> element:
     98</p>
     99<ul><li>digits and unit are interpreted as the size (ex. 120, 25%)
     100for the image
     101</li><li><tt>right</tt>, <tt>left</tt>, <tt>center</tt>, <tt>top</tt>, <tt>bottom</tt> and <tt>middle</tt> are interpreted
     102as the alignment for the image (alternatively, the first three can be
     103specified using <tt>align=...</tt> and the last three using <tt>valign=...</tt>)
     104</li><li><tt>link=some TracLinks...</tt> replaces the link to the image source by the
     105one specified using a <a class="wiki" href="/wiki/TracLinks">TracLinks</a>. If no value is specified, the link is
     106simply removed.
     107</li><li><tt>nolink</tt> means without link to image source (deprecated, use <tt>link=</tt>)
     108</li><li><tt>key=value</tt> style are interpreted as HTML attributes or CSS style
     109indications for the image. Valid keys are:
     110<ul><li>align, valign, border, width, height, alt, title, longdesc, class,
     111margin, margin-(left,right,top,bottom), id and usemap
     112</li><li><tt>border</tt>, <tt>margin</tt>, and <tt>margin-</tt>* can only be a single number
     113</li><li><tt>margin</tt> is superseded by <tt>center</tt> which uses auto margins
     114</li></ul></li></ul><p>
     115Examples:
     116</p>
     117<pre class="wiki">    [[Image(photo.jpg)]]                           # simplest
     118    [[Image(photo.jpg, 120px)]]                    # with image width size
     119    [[Image(photo.jpg, right)]]                    # aligned by keyword
     120    [[Image(photo.jpg, nolink)]]                   # without link to source
     121    [[Image(photo.jpg, align=right)]]              # aligned by attribute
     122</pre><p>
     123You can use image from other page, other ticket or other module.
     124</p>
     125<pre class="wiki">    [[Image(OtherPage:foo.bmp)]]    # if current module is wiki
     126    [[Image(base/sub:bar.bmp)]]     # from hierarchical wiki page
     127    [[Image(#3:baz.bmp)]]           # if in a ticket, point to #3
     128    [[Image(ticket:36:boo.jpg)]]
     129    [[Image(source:/images/bee.jpg)]] # straight from the repository!
     130    [[Image(htdocs:foo/bar.png)]]   # image file in project htdocs dir.
     131</pre><p>
     132<em>Adapted from the Image.py macro created by Shun-ichi Goto
     133&lt;gotoh@…&gt;</em>
     134</p>
     135<h3 id="InterTrac-macro"><code>[[InterTrac]]</code></h3><p>
     136Provide a list of known <a class="wiki" href="/wiki/InterTrac">InterTrac</a> prefixes.
     137</p>
     138<h3 id="InterWiki-macro"><code>[[InterWiki]]</code></h3><p>
     139Provide a description list for the known <a class="wiki" href="/wiki/InterWiki">InterWiki</a> prefixes.
     140</p>
     141<h3 id="KnownMimeTypes-macro"><code>[[KnownMimeTypes]]</code></h3><p>
     142List all known mime-types which can be used as <a class="wiki" href="/wiki/WikiProcessors">WikiProcessors</a>.
     143</p>
     144<p>
     145Can be given an optional argument which is interpreted as mime-type filter.
     146</p>
     147<h3 id="MacroList-macro"><code>[[MacroList]]</code></h3><p>
     148Display a list of all installed Wiki macros, including documentation if
     149available.
     150</p>
     151<p>
     152Optionally, the name of a specific macro can be provided as an argument. In
     153that case, only the documentation for that macro will be rendered.
     154</p>
     155<p>
     156Note that this macro will not be able to display the documentation of
     157macros if the <tt>PythonOptimize</tt> option is enabled for mod_python!
     158</p>
     159<h3 id="PageOutline-macro"><code>[[PageOutline]]</code></h3><p>
     160Display a structural outline of the current wiki page, each item in the
     161outline being a link to the corresponding heading.
     162</p>
     163<p>
     164This macro accepts three optional parameters:
     165</p>
     166<ul><li>The first is a number or range that allows configuring the minimum and
     167maximum level of headings that should be included in the outline. For
     168example, specifying "1" here will result in only the top-level headings
     169being included in the outline. Specifying "2-3" will make the outline
     170include all headings of level 2 and 3, as a nested list. The default is
     171to include all heading levels.
     172</li><li>The second parameter can be used to specify a custom title (the default
     173is no title).
     174</li><li>The third parameter selects the style of the outline. This can be
     175either <tt>inline</tt> or <tt>pullout</tt> (the latter being the default). The <tt>inline</tt>
     176style renders the outline as normal part of the content, while <tt>pullout</tt>
     177causes the outline to be rendered in a box that is by default floated to
     178the right side of the other content.
     179</li></ul><h3 id="RecentChanges-macro"><code>[[RecentChanges]]</code></h3><p>
     180List all pages that have recently been modified, grouping them by the
     181day they were last modified.
     182</p>
     183<p>
     184This macro accepts two parameters. The first is a prefix string: if
     185provided, only pages with names that start with the prefix are included in
     186the resulting list. If this parameter is omitted, all pages are listed.
     187</p>
     188<p>
     189The second parameter is a number for limiting the number of pages returned.
     190For example, specifying a limit of 5 will result in only the five most
     191recently changed pages to be included in the list.
     192</p>
     193<h3 id="RepositoryIndex-macro"><code>[[RepositoryIndex]]</code></h3><p>
     194Display the list of available repositories.
     195</p>
     196<p>
     197Can be given the following named arguments:
     198</p>
     199<dl class="wiki"><dt><em>format</em></dt><dd>
     200Select the rendering format:
     201<ul><li><em>compact</em> produces a comma-separated list of repository prefix
     202names (default)
     203</li><li><em>list</em> produces a description list of repository prefix names
     204</li><li><em>table</em> produces a table view, similar to the one visible in
     205the <em>Browse View</em> page
     206</li></ul></dd><dt><em>glob</em></dt><dd>
     207Do a glob-style filtering on the repository names (defaults to '*')
     208</dd><dt><em>order</em></dt><dd>
     209Order repositories by the given column (one of "name", "date" or
     210"author")
     211</dd><dt><em>desc</em></dt><dd>
     212When set to 1, order by descending order
     213</dd></dl>
     214<p>
     215(<em>since 0.12</em>)
     216</p>
     217<h3 id="TicketQuery-macro"><code>[[TicketQuery]]</code></h3><p>
     218Wiki macro listing tickets that match certain criteria.
     219</p>
     220<p>
     221This macro accepts a comma-separated list of keyed parameters,
     222in the form "key=value".
     223</p>
     224<p>
     225If the key is the name of a field, the value must use the syntax
     226of a filter specifier as defined in <a class="wiki" href="/wiki/TracQuery#QueryLanguage">TracQuery#QueryLanguage</a>.
     227Note that this is <em>not</em> the same as the simplified URL syntax
     228used for <tt>query:</tt> links starting with a <tt>?</tt> character. Commas (<tt>,</tt>)
     229can be included in field values by escaping them with a backslash (<tt>\</tt>).
     230</p>
     231<p>
     232Groups of field constraints to be OR-ed together can be separated by a
     233litteral <tt>or</tt> argument.
     234</p>
     235<p>
     236In addition to filters, several other named parameters can be used
     237to control how the results are presented. All of them are optional.
     238</p>
     239<p>
     240The <tt>format</tt> parameter determines how the list of tickets is
     241presented:
     242</p>
     243<ul><li><strong>list</strong> -- the default presentation is to list the ticket ID next
     244to the summary, with each ticket on a separate line.
     245</li><li><strong>compact</strong> -- the tickets are presented as a comma-separated
     246list of ticket IDs.
     247</li><li><strong>count</strong> -- only the count of matching tickets is displayed
     248</li><li><strong>table</strong>  -- a view similar to the custom query view (but without
     249the controls)
     250</li></ul><p>
     251The <tt>max</tt> parameter can be used to limit the number of tickets shown
     252(defaults to <strong>0</strong>, i.e. no maximum).
     253</p>
     254<p>
     255The <tt>order</tt> parameter sets the field used for ordering tickets
     256(defaults to <strong>id</strong>).
     257</p>
     258<p>
     259The <tt>desc</tt> parameter indicates whether the order of the tickets
     260should be reversed (defaults to <strong>false</strong>).
     261</p>
     262<p>
     263The <tt>group</tt> parameter sets the field used for grouping tickets
     264(defaults to not being set).
     265</p>
     266<p>
     267The <tt>groupdesc</tt> parameter indicates whether the natural display
     268order of the groups should be reversed (defaults to <strong>false</strong>).
     269</p>
     270<p>
     271The <tt>verbose</tt> parameter can be set to a true value in order to
     272get the description for the listed tickets. For <strong>table</strong> format only.
     273<em>deprecated in favor of the <tt>rows</tt> parameter</em>
     274</p>
     275<p>
     276The <tt>rows</tt> parameter can be used to specify which field(s) should
     277be viewed as a row, e.g. <tt>rows=description|summary</tt>
     278</p>
     279<p>
     280For compatibility with Trac 0.10, if there's a last positional parameter
     281given to the macro, it will be used to specify the <tt>format</tt>.
     282Also, using "&amp;" as a field separator still works (except for <tt>order</tt>)
     283but is deprecated.
     284</p>
     285<h3 id="TitleIndex-macro"><code>[[TitleIndex]]</code></h3><p>
     286Insert an alphabetic list of all wiki pages into the output.
     287</p>
     288<p>
     289Accepts a prefix string as parameter: if provided, only pages with names
     290that start with the prefix are included in the resulting list. If this
     291parameter is omitted, all pages are listed.
     292If the prefix is specified, a second argument of value 'hideprefix'
     293can be given as well, in order to remove that prefix from the output.
     294</p>
     295<p>
     296Alternate <tt>format</tt> and <tt>depth</tt> named parameters can be specified:
     297</p>
     298<ul><li><tt>format=compact</tt>: The pages are displayed as comma-separated links.
     299</li><li><tt>format=group</tt>: The list of pages will be structured in groups
     300according to common prefix. This format also supports a <tt>min=n</tt>
     301argument, where <tt>n</tt> is the minimal number of pages for a group.
     302</li><li><tt>format=hierarchy</tt>: The list of pages will be structured according
     303to the page name path hierarchy. This format also supports a <tt>min=n</tt>
     304argument, where higher <tt>n</tt> flatten the display hierarchy
     305</li><li><tt>depth=n</tt>: limit the depth of the pages to list. If set to 0,
     306only toplevel pages will be shown, if set to 1, only immediate
     307children pages will be shown, etc. If not set, or set to -1,
     308all pages in the hierarchy will be shown.
     309</li></ul><h3 id="TracAdminHelp-macro"><code>[[TracAdminHelp]]</code></h3><p>
     310Display help for trac-admin commands.
     311</p>
     312<p>
     313Examples:
     314</p>
     315<pre class="wiki">[[TracAdminHelp]]               # all commands
     316[[TracAdminHelp(wiki)]]         # all wiki commands
     317[[TracAdminHelp(wiki export)]]  # the "wiki export" command
     318[[TracAdminHelp(upgrade)]]      # the upgrade command
     319</pre><h3 id="TracGuideToc-macro"><code>[[TracGuideToc]]</code></h3><p>
     320Display a table of content for the Trac guide.
     321</p>
     322<p>
     323This macro shows a quick and dirty way to make a table-of-contents
     324for the <a class="missing wiki">Help/Guide?</a>. The table of contents will contain the Trac* and
     325<a class="wiki" href="/wiki/WikiFormatting">WikiFormatting</a> pages, and can't be customized. Search for <a class="missing wiki">TocMacro?</a> for a
     326a more customizable table of contents.
     327</p>
     328<h3 id="TracIni-macro"><code>[[TracIni]]</code></h3><p>
     329Produce documentation for the Trac configuration file.
     330</p>
     331<p>
     332Typically, this will be used in the <a class="wiki" href="/wiki/TracIni">TracIni</a> page.
     333Optional arguments are a configuration section filter,
     334and a configuration option name filter: only the configuration
     335options whose section and name start with the filters are output.
     336</p>
     337</div>
     338}}}
    71339
    72340== Macros from around the world ==