Contributors Plugin

This plugin gives a variable (%CONTRIBUTORS%) that will show information about past edits of a topic, and allows:
  • showing only up to a give revision
  • showing only a given number of lines
  • using a custom format
  • using a custom header.

The %CONTRIBUTORS% variable can be used in templates to automatically display who has edited a page and when.

Included with the plugin is a page (WebContributors) that allows the user to access the contributor history via a regular URL.

The WebContributors page is useful when publishing information with a license that requires attribution, such as several of the Creative Commons licenses. The people who create derivative works can then put a URL that embeds the web name, topic name, and the current revision number in their attribution notices.

Syntax Rules

Using the %CONTRIBUTORS% variable alone will expand to show the author, revision, and date of each edit of the current topic. Here's what it looks like"

  • DuckySherwood? -- Revision 1.4 on date Wed, 15 Dec 2004 23:26:02 GMT
  • DuckySherwood? -- Revision 1.3 on date Wed, 15 Dec 2004 22:02:55 GMT
  • DuckySherwood? -- Revision 1.2 on date Fri, 10 Dec 2004 21:57:05 GMT
  • DuckySherwood? -- Revision 1.1 on date Thu, 02 Dec 2004 17:02:37 GMT

The following arguments to %CONTRIBUTORS% are also allowed:

argument default description
web current web which web the topic of interest is in
topic current topic which topic to give change history for
rev current revision latest revision to show information for
format " * $author -- Revision $rev on date $date \$n"; format for each contributor line
header (none) string to print before printing the contributors output
nodups (none) if set to "on", suppress duplicate lines

In the format string, the user can use the following variables:

variable expands to
$author the person who made that specific change (linked to their TWiki home page)
$date the date in GMT time
$rev the revision number (linked to that revision of the page)
$n \n

In the header string, the user can use $n but no other variables (at the moment).

To use WebContributors, you pass a URL with the information you want in the query string. Note, however, that there are some differences:

  • Instead of using topic, you must use page. If you use topic, then bin/view will display that topic instead of displaying WebContributors for that topic.
  • Instead of using rev, you must use revision. If you use rev, then bin/view will expand that revision of WebContributors instead of expanding the current version of WebContributors.

Plugins Settings

  • One line description which is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = This plugin gives a variable %CONTRIBUTORS% which gives information on all revisions of a given topic.

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Examples

Use %CONTRIBUTORS{web="TWiki" topic="TWikiPreferences" last="7"}% to get


Use %CONTRIBUTORS{web="TWiki" topic="TWikiPreferences" last="7" rev="1.20"}% to get

  • PeterThoeny? -- Revision 1.20 on date Tue, 20 Nov 2001 07:30:55 GMT
  • PeterThoeny? -- Revision 1.19 on date Fri, 14 Sep 2001 02:03:17 GMT
  • PeterThoeny? -- Revision 1.18 on date Sun, 09 Sep 2001 08:05:49 GMT
  • MikeMannix? -- Revision 1.17 on date Sat, 01 Sep 2001 07:20:30 GMT
  • PeterThoeny? -- Revision 1.16 on date Fri, 17 Aug 2001 06:46:46 GMT
  • JohnTalintyre? -- Revision 1.15 on date Wed, 08 Aug 2001 08:51:59 GMT
  • JohnTalintyre? -- Revision 1.14 on date Tue, 07 Aug 2001 15:47:41 GMT


Use %CONTRIBUTORS{web="TWiki" topic="TWikiPreferences" last="7" rev="1.20" format=" * $author$n"}% to get

  • PeterThoeny?
  • PeterThoeny?
  • PeterThoeny?
  • MikeMannix?
  • PeterThoeny?
  • JohnTalintyre?
  • JohnTalintyre?

Use %CONTRIBUTORS{web="TWiki" topic="TWikiPreferences" last="7" rev="1.20" format=" * $author$n" nodups="on"}% to get

  • JohnTalintyre?
  • MikeMannix?
  • PeterThoeny?

Use %CONTRIBUTORS{web="TWiki" topic="TWikiPreferences" last="7" rev="1.20" format="|$author|$date|$rev|$n" header="|*Author*|*Date*|*Revision*|$n"}% to get:

Author Date Revision
PeterThoeny? Tue, 20 Nov 2001 07:30:55 GMT 1.20
PeterThoeny? Fri, 14 Sep 2001 02:03:17 GMT 1.19
PeterThoeny? Sun, 09 Sep 2001 08:05:49 GMT 1.18
MikeMannix? Sat, 01 Sep 2001 07:20:30 GMT 1.17
PeterThoeny? Fri, 17 Aug 2001 06:46:46 GMT 1.16
JohnTalintyre? Wed, 08 Aug 2001 08:51:59 GMT 1.15
JohnTalintyre? Tue, 07 Aug 2001 15:47:41 GMT 1.14

Plugin Installation Instructions

Plugin Installation Instructions

Note: You do not need to install anything on your Web browser to use this plugin. The installation instructions below are for installing this plugin on the TWiki server, and so only the TWiki system administrator needs to pay attention to them.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip ContributorsPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ContributorsPlugin.txt Plugin topic
    data/TWiki/ContributorsPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/ContributorsPlugin.pm Plugin Perl module
    data/TWiki/WebContributors.txt Page to allow getting revision history from a URL
    data/TWiki/WebContributors.txt,v Revision history of WebContributors
  • Test if the plugin is correctly installed:
    • Check the above examples to see if the plugin operates as expected.

Plugin Info

Plugin Author: TWiki:Main.AndreaSterbini, TWiki:Main.PeterThoeny, TWiki:Main:DuckySherwood
Plugin Version: 10 Dec 2004
Change History:  
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0
TWiki:Plugins/Benchmark: GoodStyle 100%, FormattedSearch 100%, ContributorsPlugin 100%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ContributorsPlugin (TWiki:Plugins.ContributorsPlugin)
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ContributorsPluginDev (TWiki:Plugins.ContributorsPluginDev)

Related Topics: TWikiPreferences, TWikiPlugins, DefaultPlugin?

-- TWiki:Main.AndreaSterbini - 27 Feb 2001
-- TWiki:Main.PeterThoeny - 21 Mar 2004
-- DuckySherwood? - 10 Dec 2004

navigate


click flag to translate page  -                       -  other languages see: LanguageLink

Topic revision: r4 - 16 Dec 2004 - 10:26:02 - DuckySherwood?