Edgewall Software

Changes between Version 15 and Version 16 of 0.11/TracMacros

Mar 4, 2010, 10:16:27 PM (13 years ago)
Christian Boos

replaced dynamic output of [[MacroList]] with static content obtained from a 0.11.7rc1 instance


  • 0.11/TracMacros

    v15 v16  
    2828''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].''
    30 [[MacroList]]
     31<dl><dt id="InterTrac-macro"><code>[[InterTrac]]</code></dt><dd><p>
     32Provide a list of known <a class="wiki" href="/wiki/InterTrac">InterTrac</a> prefixes.
     34</dd><dt id="TitleIndex-macro"><code>[[TitleIndex]]</code></dt><dd><p>
     35Inserts an alphabetic list of all wiki pages into the output.
     38Accepts a prefix string as parameter: if provided, only pages with names
     39that start with the prefix are included in the resulting list. If this
     40parameter is omitted, all pages are listed.
     43Alternate <tt>format</tt> and <tt>depth</tt> can be specified:
     45<ul><li><tt>format=group</tt>: The list of page will be structured in groups
     46according to common prefix. This format also supports a <tt>min=n</tt>
     47argument, where <tt>n</tt> is the minimal number of pages for a group.
     48</li><li><tt>depth=n</tt>: limit the depth of the pages to list. If set to 0,
     49only toplevel pages will be shown, if set to 1, only immediate
     50children pages will be shown, etc. If not set, or set to -1,
     51all pages in the hierarchy will be shown.
     52</li></ul></dd><dt id="RecentChanges-macro"><code>[[RecentChanges]]</code></dt><dd><p>
     53Lists all pages that have recently been modified, grouping them by the
     54day they were last modified.
     57This macro accepts two parameters. The first is a prefix string: if
     58provided, only pages with names that start with the prefix are included in
     59the resulting list. If this parameter is omitted, all pages are listed.
     62The second parameter is a number for limiting the number of pages returned.
     63For example, specifying a limit of 5 will result in only the five most
     64recently changed pages to be included in the list.
     66</dd><dt id="PageOutline-macro"><code>[[PageOutline]]</code></dt><dd><p>
     67Displays a structural outline of the current wiki page, each item in the
     68outline being a link to the corresponding heading.
     71This macro accepts three optional parameters:
     73<ul><li>The first is a number or range that allows configuring the minimum and
     74maximum level of headings that should be included in the outline. For
     75example, specifying "1" here will result in only the top-level headings
     76being included in the outline. Specifying "2-3" will make the outline
     77include all headings of level 2 and 3, as a nested list. The default is
     78to include all heading levels.
     79</li><li>The second parameter can be used to specify a custom title (the default
     80is no title).
     81</li><li>The third parameter selects the style of the outline. This can be
     82either <tt>inline</tt> or <tt>pullout</tt> (the latter being the default). The <tt>inline</tt>
     83style renders the outline as normal part of the content, while <tt>pullout</tt>
     84causes the outline to be rendered in a box that is by default floated to
     85the right side of the other content.
     86</li></ul></dd><dt id="Image-macro"><code>[[Image]]</code></dt><dd><p>
     87Embed an image in wiki-formatted text.
     90The first argument is the file specification. The file specification may
     91reference attachments in three ways:
     93<ul><li><tt>module:id:file</tt>, where module can be either <strong>wiki</strong> or <strong>ticket</strong>,
     94to refer to the attachment named <i>file</i> of the specified wiki page or
     96</li><li><tt>id:file</tt>: same as above, but id is either a ticket shorthand or a Wiki
     97page name.
     98</li><li><tt>file</tt> to refer to a local attachment named 'file'. This only works from
     99within that wiki page or a ticket.
     101Also, the file specification may refer to repository files, using the
     102<tt>source:file</tt> syntax (<tt>source:file@rev</tt> works also).
     105Files can also be accessed with a direct URLs; <tt>/file</tt> for a
     106project-relative, <tt>//file</tt> for a server-relative, or <tt>http://server/file</tt>
     107for absolute location of the file.
     110The remaining arguments are optional and allow configuring the attributes
     111and style of the rendered <tt>&lt;img&gt;</tt> element:
     113<ul><li>digits and unit are interpreted as the size (ex. 120, 25%)
     114for the image
     115</li><li><tt>right</tt>, <tt>left</tt>, <tt>top</tt> or <tt>bottom</tt> are interpreted as the alignment for
     116the image
     117</li><li><tt>link=some TracLinks...</tt> replaces the link to the image source by the
     118one specified using a <a class="wiki" href="/wiki/TracLinks">TracLinks</a>. If no value is specified, the link is
     119simply removed.
     120</li><li><tt>nolink</tt> means without link to image source (deprecated, use <tt>link=</tt>)
     121</li><li><tt>key=value</tt> style are interpreted as HTML attributes or CSS style
     122indications for the image. Valid keys are:
     123<ul><li>align, border, width, height, alt, title, longdesc, class, id
     124and usemap
     125</li><li><tt>border</tt> can only be a number
     129<pre class="wiki">    [[Image(photo.jpg)]]                           # simplest
     130    [[Image(photo.jpg, 120px)]]                    # with image width size
     131    [[Image(photo.jpg, right)]]                    # aligned by keyword
     132    [[Image(photo.jpg, nolink)]]                   # without link to source
     133    [[Image(photo.jpg, align=right)]]              # aligned by attribute
     135You can use image from other page, other ticket or other module.
     137<pre class="wiki">    [[Image(OtherPage:foo.bmp)]]    # if current module is wiki
     138    [[Image(base/sub:bar.bmp)]]     # from hierarchical wiki page
     139    [[Image(#3:baz.bmp)]]           # if in a ticket, point to #3
     140    [[Image(ticket:36:boo.jpg)]]
     141    [[Image(source:/images/bee.jpg)]] # straight from the repository!
     142    [[Image(htdocs:foo/bar.png)]]   # image file in project htdocs dir.
     144<i>Adapted from the Image.py macro created by Shun-ichi Goto
     147</dd><dt id="MacroList-macro"><code>[[MacroList]]</code></dt><dd><p>
     148Displays a list of all installed Wiki macros, including documentation if
     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.
     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!
     159</dd><dt id="TracIni-macro"><code>[[TracIni]]</code></dt><dd><p>
     160Produce documentation for Trac configuration file.
     163Typically, this will be used in the <a class="wiki" href="/wiki/TracIni">TracIni</a> page.
     164Optional arguments are a configuration section filter,
     165and a configuration option name filter: only the configuration
     166options whose section and name start with the filters are output.
     168</dd><dt id="TracGuideToc-macro"><code>[[TracGuideToc]]</code></dt><dd><p>
     169This macro shows a quick and dirty way to make a table-of-contents
     170for a set of wiki pages.
     172</dd><dt id="TicketQuery-macro"><code>[[TicketQuery]]</code></dt><dd><p>
     173Macro that lists tickets that match certain criteria.
     176This macro accepts a comma-separated list of keyed parameters,
     177in the form "key=value".
     180If the key is the name of a field, the value must use the syntax
     181of a filter specifier as defined in <a class="wiki" href="/wiki/TracQuery#QueryLanguage">TracQuery#QueryLanguage</a>.
     182Note that this is <i>not</i> the same as the simplified URL syntax
     183used for <tt>query:</tt> links starting with a <tt>?</tt> character.
     186In addition to filters, several other named parameters can be used
     187to control how the results are presented. All of them are optional.
     190The <tt>format</tt> parameter determines how the list of tickets is
     193<ul><li><strong>list</strong> -- the default presentation is to list the ticket ID next
     194to the summary, with each ticket on a separate line.
     195</li><li><strong>compact</strong> -- the tickets are presented as a comma-separated
     196list of ticket IDs.
     197</li><li><strong>count</strong> -- only the count of matching tickets is displayed
     198</li><li><strong>table</strong>  -- a view similar to the custom query view (but without
     199the controls)
     201The <tt>max</tt> parameter can be used to limit the number of tickets shown
     202(defaults to <strong>0</strong>, i.e. no maximum).
     205The <tt>order</tt> parameter sets the field used for ordering tickets
     206(defaults to <strong>id</strong>).
     209The <tt>desc</tt> parameter indicates whether the order of the tickets
     210should be reversed (defaults to <strong>false</strong>).
     213The <tt>group</tt> parameter sets the field used for grouping tickets
     214(defaults to not being set).
     217The <tt>groupdesc</tt> parameter indicates whether the natural display
     218order of the groups should be reversed (defaults to <strong>false</strong>).
     221The <tt>verbose</tt> parameter can be set to a true value in order to
     222get the description for the listed tickets. For <strong>table</strong> format only.
     223<i>deprecated in favor of the <tt>rows</tt> parameter</i>
     226The <tt>rows</tt> parameter can be used to specify which field(s) should
     227be viewed as a row, e.g. <tt>rows=description|summary</tt>
     230For compatibility with Trac 0.10, if there's a second positional parameter
     231given to the macro, it will be used to specify the <tt>format</tt>.
     232Also, using "&amp;" as a field separator still works (except for <tt>order</tt>)
     233but is deprecated.
     235</dd><dt id="InterWiki-macro"><code>[[InterWiki]]</code></dt><dd><p>
     236Provide a description list for the known <a class="wiki" href="/wiki/InterWiki">InterWiki</a> prefixes.
     238</dd><dt id="TracAdminHelp-macro"><code>[[TracAdminHelp]]</code></dt><dd><p>
     239Displays help for trac-admin commands.
     244<pre class="wiki">[[TracAdminHelp]]               # all commands
     245[[TracAdminHelp(wiki)]]         # all wiki commands
     246[[TracAdminHelp(wiki export)]]  # the "wiki export" command
     247[[TracAdminHelp(upgrade)]]      # the upgrade command
    32251== Macros from around the world ==