r3 - 13 Nov 2006 - 16:31:47 - FredericLuddeni?You are here: TWiki >  TWiki Web > DiffWordByWordAddOn

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).

For the impatient: add-on test

Screenshot inplace-view Screenshot sbs-view
Screenshot inplace-raw Screenshot sbs-raw

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 and css
    • A modified Python application to process the diff word by word
    • An optional patch to replace the current TWiki Diff

How to use this new Diff

  • If you use the optional patch all references to the current diff (in view mode) are replaced by this diff word by word
  • If you don't use this patch you can test it by replacing the binary script in your url (example view or rdiff) by rdiffword/rdiffwordauth

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.0.x (with x > 2)
  • Python 2.2 to execute the modified diff Python application
  • Perl dependency:
    Name Description
    File::Temp Required. Available from CPAN

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
    bin/rdiffword Perl binary
    bin/rdiffwordauth Perl binary
    lib/TWiki/UI/RDiffWord.pm Perl module
    lib/Python/webdiff Python module
    templates/rdiffword.pattern.tmpl Template for display the Diff
    pub/TWiki/PatternSkin/diffword.css New CSS styles
    pub/TWiki/PatternSkin/addedMarker.png Button image
    pub/TWiki/PatternSkin/deletedMarker.png Button image
    pub/TWiki/PatternSkin/btn_end.gif Button image
    pub/TWiki/PatternSkin/btn_next.gif Button image
    pub/TWiki/PatternSkin/btn_prev.gif Button image
    pub/TWiki/PatternSkin/btn_start.gif Button image
    pub/TWiki/PatternSkin/oopsmore_diffword_inplace.png More action image
    pub/TWiki/PatternSkin/oopsmore_diffword_sidebyside.png More action image
    diffword.optional.patch Optional patch for Dakar 4.0.x (x > 2)

  • Optional patch: Execute the following command to automatically replace the TWiki diff by this: patch -p0 -i diffword.optional.patch
    Modifications:
    File: Modification:
    lib/TWiki/UI/view.pm Replace rdiff by rdiffword
    templates/oopsmorecompare.pattern.tmpl Replace rdiff by rdiffword
    templates/search.pattern.tmpl Replace rdiff by rdiffword
    templates/searchbookview.pattern.tmpl Replace rdiff by rdiffword
    templates/mailnotify.tmpl Replace rdiff by rdiffword
    templates/viewtopicactionbuttons.pattern.tmpl Replace rdiff by rdiffword

Uninstallation

  • Execute this command to undo the optional patch: patch -p0 -R -i diffword.optional.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
    bin/rdiffword Perl binary
    bin/rdiffwordauth Perl binary
    lib/TWiki/UI/RDiffWord.pm Perl module
    lib/Python/webdiff Python module
    templates/rdiffword.pattern.tmpl Template for display the Diff
    pub/TWiki/PatternSkin/diffword.css New CSS styles
    pub/TWiki/PatternSkin/addedMarker.png Button image
    pub/TWiki/PatternSkin/deletedMarker.png Button image
    pub/TWiki/PatternSkin/btn_end.gif Button image
    pub/TWiki/PatternSkin/btn_next.gif Button image
    pub/TWiki/PatternSkin/btn_prev.gif Button image
    pub/TWiki/PatternSkin/btn_start.gif Button image
    pub/TWiki/PatternSkin/oopsmore_diffword_inplace.png More action image
    pub/TWiki/PatternSkin/oopsmore_diffword_sidebyside.png More action image
    diffword.optional.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

Add-on Author: TWiki:Main/FredericLuddeni (Special thanks to TWiki:Main/ColasNahaboo for his help and feedback)
Add-on Version: 13 Nov 2006 (v1.02)
Copyright: © ILOG S.A. 2006
Supported version Dakar 4.0.x (with x > 2)
Change History:  
13 Nov 2006: Version 1.02: Documentation updated, Zip file rename form TwikiDiffWord.zip to DiffWordByWordAddOn.zip
10 Nov 2006: Version 1.01: new release for Dakar 4.0.5
31 May 2006: Initial version 1.00 for Dakar 4.0.2
Known bugs:  
31 May 2006 Text is not wrap (with IE) with raw/html rendering style
CPAN Dependencies: File::Temp
Other Dependencies: Python 2.2
License: GPL
Add-on Home: http://TWiki.org/cgi-bin/view/Plugins/DiffWordByWordAddOn
Feedback: http://TWiki.org/cgi-bin/view/Plugins/DiffWordByWordAddOnDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/DiffWordByWordAddOnAppraisal

-- TWiki:Main/FredericLuddeni - 31 May 2006

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Cornell Math Department
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.DiffWordByWordAddOn