List all Wiki Pages with Author and Last Changed Date
This macro prints a table of all (user generated, ie non-Trac-default) wiki pages with last changed date and author as requested in #2427. Version 0.2 provides also a long format which also includes the newest version number and links to the difference and the history as well as the last comment. This was requested by #4717.
The second macro provided by this package is
LastChangesBy, which prints the last changes made by the given user or the logged-in user if no username is given.
This package uses the AdvParseArgsPlugin, which must also be installed.
If you have any issues, create a new ticket.
Download and Source
Download the zipped source from here.
General instructions on installing Trac plugins can be found on the TracPlugins page.
Put the following into your
trac.ini configuration file:
[components] traclistofwikipages.* = enabled [listofwikipages] # Optional list of ignored users, defaults to 'trac' to ignore Trac's default wiki pages: #ignore_users = trac # Select default format 'long' or 'short'. Defaults to 'short' which is the pre-v0.2 format. #default_format = long #default_format = short
You can use the
ListOfWikiPages macro like this:
[[ListOfWikiPages]] # default format as given in the configuration file [[ListOfWikiPages(format=short)]] # short format [[ListOfWikiPages(format=long)]] # long format (new v0.2)
which prints a table of all wiki pages, or with a list of wiki pages:
Since v0.3 the optional arguments
to can be used to specify a time/date range as requested by #5344.
The values of this arguments are taken as negative offsets to the current time, that is the time that the wiki page is displayed.
Allowed is a number followed by a unit which can be
y for seconds, minutes, hours, days, weeks, months and years.
If the unit is missing, then seconds are assumed.
[[ListOfWikiPages(from=3d)]] # displays all wiki pages changed in the last 3 days [[ListOfWikiPages(to=15m)]] # displays all wiki pages changed more than 15 minutes ago [[ListOfWikiPages(from=4.5w,to=15h)]] # displays all wiki pages changed between 4 1/2 weeks and 15 hours ago
A headline can be given using a
[[ListOfWikiPages(headline=Headline text without any comma)]] # sets a table headline, may not contain '`,`'
The order can be reversed, ie list the oldest wikis first, using:
Unwanted wiki ranges, eg
Trac*, can be excluded by the
exclude=pattern option which can be given multiple times.
The wildcards '
*' (matches everything) and '
?' (matches a single character) can be used in the pattern (requested in #6074).
The resulting table looks like this in the
long format (example links not functional). The
short format simply lacks the columns
|WikiPage||Last Changed At||By||Version||Diff||History||Comment|
|SandBox||10/24/09 12:21:21 (98 minutes ago)||martin||43||Diff||History|
|test||10/24/09 05:22:14 (9 hours ago)||martin||3||Diff||History|
|TracLinks||10/21/09 15:05:36 (3 days ago)||martin||4||Diff||History||Replaced "raw-attachment:" with "htdoc:dl/".|
This macro prints a table similar to the one above only with the By column missing and the author name in the table head.
[[LastChangesBy(martin_s)]] # the last 5 changes by user `martin_s` [[LastChangesBy(martin_s,10)]] # the last 10 changes by user `martin_s` [[LastChangesBy]] # or [[LastChangesBy()]] # the last 5 changes by the current user, ie every logged-on user sees its own changes [[LastChangesBy(,12)]] # the last 12 changes by the current user [[LastChangesBy(...,format=...]] # Selects `long` or `short` table format [[LastChangesBy(...,from=..,to=..]] # Selects `from` and `to` time/date range [[LastChangesBy(...,headline=...]] # Overwrites headline, may not contain `','`. [[LastChangesBy(...,order=reverse]] # Lists the wikis in reverse order. Only useful with few wiki pages or with `to`/`from`. [[LastChangesBy(..,exclude=pattern]] # Excludes wiki pages matching `pattern`. Wildcards `*` and `?` are supported.
The resulting table looks like this in the
|Last 3 changes by martin|
|WikiPage||Last Changed At||Version||Diff||History||Comment|
|SandBox||10/24/09 12:21:21 (98 minutes ago)||43||Diff||History|
|test||10/24/09 05:22:14 (9 hours ago)||3||Diff||History|
|TracLinks||10/21/09 15:05:36 (3 days ago)||4||Diff||History||Replaced "raw-attachment:" with "htdoc:dl/".|
- 15550 by rjollos on 2016-05-15 08:01:40
0.4: Add encoding statement to source files
Patch by ntmlod.
- 15264 by rjollos on 2016-02-11 05:22:34
Remove unnecessary svn:mime-type on py files
svn:mime-type was set to "plain" for many files.
- 8549 by martin_s on 2010-08-30 23:57:45
Added encoding meta-comment and declared SVN keywords as unicode to avoid issues with non-english locales.