Tags:
create new tag
, view all tags

RevisionLinkPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on RevisionLinkPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Development discussion for RevisionLinkPlugin

-- RichardBaar - 05 Aug 2003

This is a good idea Richard. I've wished for something like this from time to time.

One for the suggestion box: the option to use relative numbers instead of explicit ones. E.g. show me rev -1 from now, or -2, -3 etc.

-- MattWilkie - 05 Aug 2003

I did some minor editing of the Plugins topic. Remember that your signature will be broken if installed on a site unless you write TWiki:Main/RichardBaar.

-- PeterThoeny - 05 Aug 2003

How difficult would it be to change the wiki syntax to use appended vXX.YY or _XX_YY notation, for example, RevisionLinkPluginDevv1.2 or RevisionLinkPluginDev_1_2 ?

The current wiki syntax using variable expansion is a bit heavy.

-- JonathanCline - 29 Aug 2003

Hi Jonathan, it is not so difficult. If you want to do this change go to the RevisionLinkPlugin.pm file and change this line:

$_[0] =~ s/%REV[{\[](.*)[}\]]%/&handleRevision($1)/geo;
to:
$_[0] =~ s/([A-Z]+[a-z]+[A-Z]+[A-Za-z0-9]*\_\d*\_\d*)/&handleMyRevision($1)/geo;

Now you can use WikiTopic_1_13 syntax for getting appropriate revision. All you have to do is create function handleMyRevision where you parse the founded string in your way. But with this solution is problem that you can't use formated output, negative numbers for revision etc. That's why I used the %REV% syntax.

-- RichardBaar - 01 Sep 2003

If you go the way of extending the WikiWord syntax, you can simplify this and also make it compatible with InternationalisationEnhancements - just use the following:

$_[0] =~ s/(${wikiWordRegex}_\d+_\d+)/&handleMyRevision($1)/geo;

You'll also need to import the $wikiWordRegex variable from CVS:lib/TWiki.pm - see InterwikiPlugin (CVS:lib/TWiki/Plugins/InterwikiPlugin.pm) for how to do this. Doing it this way means that non-English TWiki users can benefit from your plugin, as well as those who want to redefine the definition of WikiWords (now just a single line change in TWiki.pm).

I've also fixed the regex a bit so that it requires at least one digit per revision.

Let me know if you go this route, as the Plugin API really needs to be updated to handle import of the I18N regexes.

-- RichardDonkin - 03 Sep 2003

I'll suggest the following lightweight syntax. Though note that TWiki never uses anything greater than 1.xxx (which in itself could be a low-priority enhancement).

Main.WikiWord RevisionLinkPlugin Result
RevisionLinkPlugin,v1_2 Specific revision of the topic, revision 1.2
RevisionLinkPlugin,v-2 Specific revision of the topic, two revisions prior to the current revision
RevisionLinkPlugin,v+2 Specific revision of the topic, two revisions later to the current revision

Not difficult and for optimization, use additional args,

$_[0] =~ s/(${wikiWordRegex}),v(([+-])\d+)_(\d+))/&handleMyRevision($1, $2, $3)/geo;
$_[0] =~ s/(${wikiWordRegex}),v([+-])(\d+)/&handleMyRevision($1, $2, $3)/geo;

The variable syntax is still necessary for custom formatting, of course.

-- JonathanCline - 05 Sep 2003

See related WikiWordLinkAttributes idea in the Codev web.

-- PeterThoeny - 09 Sep 2003

checked source into CVS

would someone familiar with this topic please refactor it?

-- WillNorris - 15 Feb 2005

The zip file has the files in an incorrect tree structure.

e.g.

 
RevisionLinkPlugin/lib/TWiki/Plugins/RevisionLinkPlugin.pm

instead of

lib/TWiki/Plugins/RevisionLinkPlugin.pm

-- BrendanGibson - 24 Feb 2005

To the Plugin maintainer: As reported in RevisionLinkPluginErrors, this Plugin does not seem to work in TWiki 4. Please consider upgrading this Plugin so that it runs on Cairo and Dakar codebase. HandlingCairoDakarPluginDifferences has more.

-- PeterThoeny - 15 May 2006

I have upgraded the plugin so it works in both TWiki4 (Dakar) and Cairo. I also fixed some bugs.

-- KennethLavrsen - 18 May 2006

You are so cool Kenneth thumbs up

-- PeterThoeny - 18 May 2006

Impressive, Kenneth! As long as we can count on this not affecting your testing deliverances, you are invited to apply them new skills at free will! wink

-- SteffenPoulsen - 19 May 2006

Not working with TWiki 4.0.4; can't locate object method "_getHandler". Looks like the contents of the Zip file did not get updated! Perl module has a revision data of 2003.

-- ChuckEhrlich - 13 Sep 2006

Something is wrong with the meta data of the RevisionLinkPlugin topic. Yes, the zip file downloaded via viewfile script is old. Here is the direct link of the latest version: http://www.twiki.org/p/pub/Plugins/RevisionLinkPlugin/RevisionLinkPlugin.zip

-- PeterThoeny - 13 Sep 2006

I see no mention regarding linking to a specific revision of an attachment. I'm having problems linking to specific revisions of topics and attachments. They seem to be getting re-written to new-topic URLs, and it sounds like the RevRecoverPlugin may have been written to fix that issue. The problem is that it doesn't seem to be tested / maintained for TWiki4. This plugin's interface looks a lot cleaner, and I'd like to use it, but what about attachments?

-- BryceSchober - 20 Nov 2006

I re-attached the latest version to the plugins topic, RevisionLinkPlugin.zip

-- PeterThoeny - 20 Nov 2006

Is there an easy way to change the default appearance of a link created with the RevisionLinkPlugin ? The syntax is so robust that I can never remember how to use it and always have to go to the docs (don't make me think smile ). So I'd like to dumb down the default syntax & display if I can.

If I were to type %REV{1.28}% (super easy to remember how to do), I would like for this to appear in the topic as if I had typed %REV{rev="1.28" format="$rev"}% (super simple display). Is there an easy way to make this change ? Thanks!

-- KeithHelfrich - 26 Dec 2006

Edit | Attach | Watch | Print version | History: r21 < r20 < r19 < r18 < r17 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r21 - 2006-12-26 - KeithHelfrich
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.