ARC TWiki
>
TWiki Web
>
RevisionLinkPlugin
(2010-11-11,
TWikiContributor
)
(raw view)
Ra
w
edit
|
E
dit
A
ttach
---+!! Revision Link Plugin <!-- Contributions to this TWiki plugin are appreciated. Please update the plugin page at http://twiki.org/cgi-bin/view/Plugins/RevisionLinkPlugin or provide feedback at http://twiki.org/cgi-bin/view/Plugins/RevisionLinkPluginDev. If you are a TWiki contributor please update the plugin in the SVN repository. --> <sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;"> %TOC{title="Page contents"}% </div></sticky> %SHORTDESCRIPTION% ---++ Introduction This plugin enables the author of a TWiki page to specify a particular version of a topic to link to. You can use also negative numbers when specifying the revision number which means a revision back in time relative to the current revision. Some examples of how the plugin works when installed. =%<nop>REV{"WebHome" rev="1"}%= becomes [[%SCRIPTURLPATH{"view"}%/%WEB%/WebHome?rev=1][WebHome(1)]] =%<nop>REV{"WebHome" web="TWiki" rev="1" format="$web.$topic(rev: $rev)"}%= becomes [[%SCRIPTURLPATH{"view"}%/TWiki/WebHome?rev=1][WebHome(rev: 1)]] ---++ Syntax Rules | =%<nop>REV{"1"}%= | Points to current topic in specified revision, TWiki/TWiki4 revision syntax | | =%<nop>REV{"1.1"}%= | Points to current topic in specified revision, Cairo revision syntax | | =%<nop>REV{"-2"}%= | Points to current topic in revision which was two times back | | =%<nop>REV{"SomeTopic" rev="1"}%= | Points to specified topic in specified revision | | =%<nop>REV{rev='1' "SomeTopic"}%= | Same as above. Syntax is very flexible. | | =%<nop>REV{"SomeTopic" web="AWeb" rev="1"}%= | Points to specified topic in web | | =%<nop>REV{"SomeTopic" web="AWeb" rev="1" format="$web.$topic(rev=$rev)"}%= | Points to specified topic in web and formats the output | | =%<nop>REV{"SomeTopic" web="AWeb" rev="1" attachment="filename.png" format="$web.$topic - $attachment(rev=$rev)"}%= | Points to specified attachment of topic formats the output | You can specify also the topic by topic attribute, i.e. %<nop>REV{topic="ATopic" rev="1"}% Revision can be given as input either in TWiki/TWiki4 format (1, 2, 3,...) or the old Cairo syntax (1.1, 1.2, 1.3, ...). Revision is however always shown in TWiki/TWiki4 syntax (without the 1. prefix). ---+++ Syntax and variables in 'format' attribute You can use these variables: | *Variable* | *Description* | | =$web= | The web name for the target topic | | =$topic= | The name of the target topic | | =$attachment= | The filename of an attachment | | =$rev= | The revision of the target topic or attachment | | =$date= | The date (in epoch) of the target topic or attachment. | | =$user= | The author of the target topic or attachment | | =$comment= | The comment given when uploading an attachment | As default the whole string is used as link to appropriate revision. If you write more complex format string and you don't want to link only part of the string encapsulate it with *!*. Ex. %<nop>REV{"ATopic" web="AWeb" rev="1" format="| $date | $user | !$web.$topic(rev=$rev)! |"}%. ---++ Examples | %REV{1}% | Points to current topic in specified revision | | %REV{"1"}% | Points to current topic in specified revision | | %REV{"1.1"}% | Points to current topic in specified revision (Cairo syntax as input but TWiki as output) | | %REV{"CommentPlugin" rev="3"}% | Points to specified topic in specified revision | | %REV{"WebHome" web="TWiki" rev="1"}% | Points to specified topic in web | | %REV{"WebHome" web="TWiki" rev="1" format="$web.$topic(rev=$rev)"}% | Points to specified topic in web and formats the output | | %REV{"ProjectLogos" web="TWiki" rev="1" attachment="twiki-logo.png" format="$web.$topic - $attachment(rev=$rev)"}% | Points to specified attachment of topic formats the output | Example of more complex format attribute:<br /> %REV{"WebHome" web="TWiki" rev="1" format="| $date | <nop>$user | !$web.$topic(rev: $rev)! | $comment |"}% ---++ <nop>%TOPIC% Settings Plugin settings are stored as preferences variables. The following variables are used for this plugin. * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Enable linking to specific topic revisions * Debug plugin: (See output in =data/debug.txt=) * Set DEBUG = 0 ---+++ Plugin Installation Instructions *Note:* You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server. * Download the ZIP file from the plugin web (see below) * Unzip ==%TOPIC%.zip== in your TWiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | * Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section. * Test if the installation was successful: * %REV{"1"}% ---+++ Plugin Info | Plugin Author: | TWiki:Main.RichardBaar, TWiki:Main.KennethLavrsen | | Copyright: | © 2003 TWiki:Main.RichardBaar, <br /> 2006-2009 TWiki:Main.KennethLavrsen <br /> © 2006-2010 TWiki:TWiki/TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | 2.2 (27 Jan 2009) | | Change History: | <!-- versions below in reverse order --> | | 27 Jan 2009 (2.2) | TWiki:Main.KennethLavrsen<br />Added support for linking to revisions of attachments<br />Removed the odd alternative square bracket syntax. It is probably few that ever used it because the many past years it has not been a problem using the normal syntax in form fields. The removal of this syntax enabled using the registerTagHandler instead of the much less efficient commonTagsHandler | | 16 Feb 2007 (2.1) | TWiki:Main.KennethLavrsen<br />Fixed bug when having more than one REV tag in same topic | | 18 May 2006 (2.0) | TWiki:Main.KennethLavrsen<br />updated plugin to Dakar while maintaining Cairo compatibility.<br />Enhanced the syntax robustness.<br />Fixed some rendering errors when plugin was used several times on same topic.<br />Fixed the plugin so only official API is used. | | 27 Aug 2003 (1.11) | Repaired link when "web" attribute specified | | 14 Aug 2003 (1.1) | You can specify revision only with one number (ex. %<nop>REV{"5"}%)<br>You can use negative numbers for revision (ex. %<nop>REV{"-2"}%)<br>Enhanced syntax (added characters *[* and *'*)<br>Added variables $date, $user and $comment to format attribute | | 05 Aug 2003 (1.0) | Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.0 | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.008 | | Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://twiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | __Related Topics:__ %SYSTEMWEB%.TWikiPreferences, [[%USERSWEB%.TWikiPreferences]], %SYSTEMWEB%.TWikiPlugins This work was sponsored by [[http://www.systinet.com][Systinet Corp.]]
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2010-11-11
-
TWikiContributor
TWiki
Log In
TWiki Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
External
Main
Sandbox
TWiki
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding ARC TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.RevisionLinkPlugin
.