History Plugin

The output can arbitrarily be formatted. An example for a Wikipedia-like history is included.

When using PatternSkin enabling the HistoryPlugin changes the "History" link in the bottom action bar so it opens a page with a nice user interface where you can select the versions to compare.

With other skins for Foswiki you will need to tweak the templates.

If CompareRevisionsAddOn is installed and activated the "History" user interface will allow you to choose how the changes are rendered (interweaved vs side-by-side, and context).

If RevCommentPlugin is installed and activated the "History" page will show the comments entered for each revision.

This plugins is designed to work together with CompareRevisionsAddOn and RevCommentPlugin but works well on its own or with just one of the two other plugins.

Syntax Rules

Syntax: %HISTORY{ attributes }%

Parameter

Description

Default

"format"format="format"

Format of one line, may include any variable which is supported by macro REVINFO

r$rev - $date - $wikiusername

topic

Topic name, can be in web.topic format

current topic

web

Web name

current web

versions

Number or range (format: from..to). Examples: To get version 2, write: versions="2" To get version 2 to 3, write: versions="2..3" To get version 2 to the latest, write: versions="2.." To get all versions up to version 5, write: versions="..5" To get all versions up to but not including the latest, write: versions="..-1" To get the versions from 1 to 5 in reverse order, write: versions="5..1"

all versions in the order latest to first

header

Text to print before the list. May contain the tokens $next and $previous which will be evaluated if there are newer or older revisions available for the topic that are not listed according to versions (or rev1, rev2, nrev). These tokens take the syntax $next{'some text' url='url'} (the same for $previous). 'some text' is the text which should be printed, 'url' is the url for the corresponding link. The tokens $rev1, $rev2, $nrev in 'text' or 'url' will be replaced by appropriate values for the next or previous block of revisions. See the attached oopshistory.tmpl for an example of how to use this.

$next

footer="text"

Text to print after the list. May contain the tokens $next and $previous (see header)

$previous

Deprecated (but supported) parameters:

Parameter

Description

Default

nrev

Number of revisions to show. Ignored if versions is specified, or if both rev1 and rev2 are specified.

10

rev2

Newest revision to show

rev1+nrev if rev1 is specified, latest revision otherwise

rev1

Oldest revision to show

rev2-nrev

reverse

Show newest revisions first, if on

"on"

Additional macros

The following macros are expanded only if there is a corresponding %HISTORY% on the page. If more than one %HISTORY% is used on the same page, the values from the last one will be used.

%HISTORY_REV1%: Oldest revision from the printed history

%HISTORY_REV2%: Latest revision from the printed history

%HISTORY_NREV%: Number of the printed revisions

%HISTORY_MAXREV%: Latest available revision of the topic

Custom settings:

If the preference variable HISTORYPLUGIN_NREV is set, it overrides the default number of revisions shown in history when the topic History link is
selected. For example, the following setting changes the revisions shown to 5. Copy this setting into a topic to enable it for a pariticular topic,
user, Web, or site wide. See PreferenceSettings.

1.5 Kenneth Lavrsen: Small cosmetic updates. Changed the author name to non liked to avoid bogus links to Main.loginname. Changed some CSS names to Foswiki that I missed in 1.4

08 Dec 2008:

1.4 Kenneth Lavrsen: Changed the author to myself. JChristophFuchs is the original author but announced in 2006 that he no longer maintains this plugin. So now I officially take the task as maintainer. Plugin is changed to Foswiki namespace and tested and works under Foswiki 1.0.0

09 Dec 2007:

1.3 Kenneth Lavrsen: Restored the features that were lost in revision 1.1 including: Showing comments made by RevCommentPlugin, selection of render styles "interweave" and "side by side" provided by CompareRevisionsAddOn, and link to rdiff history. Restored compatibility with older releases, which means removing the dependency of 4.2 only CSS feature. Updated the default rev format to 4.X format.

13 Nov 2007:

1.2 Michael Daum: removed cruft from plugin, updates to use modern APIs, added some more flexibility to create a diff interface, removed plugin topic options

07 Nov 2007:

1.1 Arthur Clemens: improved user interface.

19 Jan 2007:

1.002 Corrected coding error that causes the plugin to fail with HISTORY tag in topic