Patch Proposal: [Putting anchors in Rdiff output]
Motivation
- The inline diff in WebChangesForAllWebs (check my comments there)
- Could be nice if inline jumps right to first diff
- Easy to hack
RDiff.pm to include <a name="diff001"></a> on first difference, diff002 on next, etc.
Description
For
sequential rendered the following is now true:
- all diffs (changes, adds, deletes) are anchored: #diff001, #diff002, ...
- rdiffs will contain a next and previous link
- the < marked comparison between revisions (at the bottom) will include a
&context=9999 -
- I guess this will make most sense to most non-technical users - this part is marked code smells.
- This change is marked
CODE SMELLS - might be an idea to make this configurable (through TWiki.cfg like numberOfRevisions ?).
- anchors are given CSS class
twikiNextRdiff
Documentation
Well, I don't think
rdiff is well documented, or is it?
Anyway, something like the text below should make it into
rdiff doc
Jumping directly to diff
When you present users with an
inline diff add the anchor
#diff001 to avoid scrolling the 10 pages down to find first diff...
Example
- Sample, that may replace
%REVINFO% in the TMPL:DEF{toolbar} of the pattern skin template file view.pattern.tmpl
-
%REVINFO{"<a title=\"Show last change as inline diff\" href=\"%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic?type=last&render=sequential&context=30000#diff001\">r1.$rev - $date - %CALC{"$PROPERSPACE($wikiname)"}%</a>"}%
Examples
See above - and
WebChangesForAllWebs
Implementation
- It uses a global variable to name anchors
- It only anchors
sequential rendered rdiffs - but based on motivation I guess that is okay.
- Maybe make the CODE SMELL part user configurable.
Note: Patch is attached as
RDiff-change-request.diff
The patch is against Cairo:
TWikiRelease02Sep2004
Discussion:
I would like to propose this for Dakar.
--
NielsKoldso - 02 Sep 2005
context=9999 isn't enough for some topics e.g.
PatternSkinDev. Maybe a context=all is needed?
--
SamHasler - 03 Sep 2005
i like this and have often wanted it myself. any chance you can make a patch against the
DevelopBranch codebase?
--
WillNorris - 03 Sep 2005
Will:
Mayby... do not know how hard it will be to set up
DevelopBranch, will look into it next time I get some
coding time
Sam: I will try to incooperate
context=all
--
NielsKoldso - 13 Sep 2005
Unless this is done within the next 24 hours, it isn't going to make it into
DakarRelease, so setting it to Edinburgh. Though I have a gut feeling that someone may already have implemented it....