TWiki Diff word by word Add-on
Support for the integration of Diff word by word. Comes bundled with a modified
diff Python
application.
This add-on compares two revisions and shows differences with a word by word context. These differences can be visualized in normal view, html code or TML code using two layouts (in place and side by side).

: the 1.03 release is more TWiki independant to facilitate update:
The TWiki distribution has been patch to allow administrator to select a specific Diff from the configuration page.
By this way, other diff which will implement RDiff.pm procedures should be integrated.
For the impatient: add-on test
Features
- Diff with word by word context
- Several parameters are editables by the interface:
- Revisions to compare
- The layout {
in place and side by side }
- The rendering style {
Normal view (like the view script), raw view (TML view) and html code }
- With the rendering styles
raw view and html code you can select a line number to higtlight it. This selection creates a new URL that you can send to another person
- Comes with additional templates and doesn't edit current TWiki files (except if you use the optional patch which replaces all the references from rdiff to rdiffword script but undo is always possible).
Demo
Details
What's in the package
- The package includes the following pieces:
- New templates, perl scripts, icons, css and a patch
- A modified Python application
to process the diff word by word
Parameters
-
rev1: by default the higher revision
-
rev2 : by default the lower revision
-
layout: the layout style {inplace, sidebyside}. Preferences: DIFFWORDLAYOUTSTYLE (default: inplace )
-
render: the rendering style {view, raw, html}. Preferences: DIFFWORDRENDERSTYLE (default: view )
-
skin: the skin used to display the diff
-
sel: the selected line number
Add-On Installation Instructions
Requirements
- TWiki dakar 4.x (with x > 2)
- Python 2.2 to execute the modified diff Python application
- Perl dependency:
Installation
- Download the ZIP file from the Plugin web (see below)
- Unzip
DiffWordByWordAddOn.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/DiffWordByWordAddOn.txt | Add-on topic |
data/TWiki/DiffWordByWordAddOn.txt,v | Add-on topic repository |
pub/TWiki/DiffWordByWordAddOn/inplace-raw.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/inplace-view.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/sbs-raw.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/sbs-view.jpg | Add-on topic image |
lib/TWiki/UI/RDiffWord.pm | Perl module |
lib/Python/webdiff | Python module |
templates/rdiffword.pattern.tmpl | Template for display the Diff |
templates/viewtopicactionbuttons.rdiffword.tmpl | Template to integrate this Add-on in the topic action buttons bar |
templates/oopsmore.rdiffword.tmpl | Template to integrate this Add-on in the more topic |
pub/TWiki/PatternSkinCustomization/diffword.css | New CSS styles |
pub/TWiki/PatternSkinCustomization/addedMarker.png | Button image |
pub/TWiki/PatternSkinCustomization/deletedMarker.png | Button image |
pub/TWiki/PatternSkinCustomization/btn_end.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_next.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_prev.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_start.gif | Button image |
pub/TWiki/PatternSkinCustomization/oopsmore_diffword_inplace.png | More action image |
pub/TWiki/PatternSkinCustomization/oopsmore_diffword_sidebyside.png | More action image |
diffword.patch | Patch for Dakar 4.x (x > 2) to integrate this diff |
- Execute the following command to automatically integrate the new TWiki diff:
patch -p1 -i diffword.patch
Modifications: | File: | Modification: |
bin/rdiff | take in charge a new configuraiton variable to call a specific diff |
bin/rdiffauth | take in charge a new configuration variable to call a specific diff |
lib/TWiki.spec | New diff variable to activiate the diff from the configuration page (Miscellaneous settings section) |
- Go to your TWiki configuration url
- In the "Miscellaneous settings" update the "DiffMod" parameters
- To enable the new oopsmore template update SKIN variable in your TWikiPreferences page by adding the 'rdiffword' skin.
- ex.: if your skin is "SET SKIN = pattern" replace this line by "Set SKIN = rdiffword, pattern"
Uninstallation
- Execute this command to undo the patch:
patch -p1 -R -i diffword.patch
- Remove files:
data/TWiki/DiffWordByWordAddOn.txt | Add-on topic |
data/TWiki/DiffWordByWordAddOn.txt,v | Add-on topic repository |
pub/TWiki/DiffWordByWordAddOn/inplace-raw.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/inplace-view.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/sbs-raw.jpg | Add-on topic image |
pub/TWiki/DiffWordByWordAddOn/sbs-view.jpg | Add-on topic image |
lib/TWiki/UI/RDiffWord.pm | Perl module |
lib/Python/webdiff | Python module |
templates/rdiffword.pattern.tmpl | Template for display the Diff |
templates/viewtopicactionbuttons.rdiffword.tmpl | Template to integrate this Add-on in the topic action buttons bar |
templates/oopsmore.rdiffword.tmpl | Template to integrate this Add-on in the more topic |
pub/TWiki/PatternSkinCustomization/diffword.css | New CSS styles |
pub/TWiki/PatternSkinCustomization/addedMarker.png | Button image |
pub/TWiki/PatternSkinCustomization/deletedMarker.png | Button image |
pub/TWiki/PatternSkinCustomization/btn_end.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_next.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_prev.gif | Button image |
pub/TWiki/PatternSkinCustomization/btn_start.gif | Button image |
pub/TWiki/PatternSkinCustomization/oopsmore_diffword_inplace.png | More action image |
pub/TWiki/PatternSkinCustomization/oopsmore_diffword_sidebyside.png | More action image |
diffword.patch | Optional patch |
Configuration Settings
- Set DIFFWORDLAYOUTSTYLE = The name of the default layout {
inplace (default), sidebyside }
- Set DIFFWORDRENDERSTYLE = The name of the default rendering style {
view (default), raw , html }
Add-On Info
- Set SHORTDESCRIPTION = Show word-by-word differences between revisions of topics
--
TWiki:Main/FredericLuddeni
- 31 May 2006