Skip to content.

Personal tools
You are here: Home » Development » Plone Improvement Proposals
Log in
You can submit bug reports and feature requests to the Plone Collector
We currently host development of Plone at SourceForge
There is also a development Wiki available for the Plone Developers.
Help regarding Plone development and deployment is available in the news groups and mailing lists.


last edited 2 weeks ago by limi


  • Description - Allow document-oriented content types to be compared, mostly between versions.
  • PLIP - 19
  • Proposer - Alexander Limi
  • Seconder -
  • Status - Draft


  1. Definitions
  2. Motivation
  3. Assumptions
  4. Proposal
  5. Implementation
  6. Deliverables
  7. Risks
  8. Time line
  9. Participants

1. Definitions

Short-hand for "difference" - a very common command on Unix to analyze and show the differences between two versions of a file.

2. Motivation

Contributors can have multiple versions of the same resource. Even without versioning, they use filenames such as mydoc-01.txt to distinguish between versions. Sometimes they want to compare one version to another.

This PLIP provides a simple way to see the differences between two resources. It is focused on the document-oriented content of a content type, mainly the kind of content a visual editor like Epoz produces.

3. Assumptions

This PLIP does not provide a way to update a version from another version (i.e. patch). Nor does it try to show differences outside the document-portion of the content, such as in the title or description.

The mechanism provides no way of showing the differences of anything else than items with body text.

4. Proposal

A diffing mechanism should be implemented, that allows the contributor to compare one content type to another one of the same type.

5. Implementation

It is likely that the libdiff library in Python 2.3 will be used. There are already mailing list examples that show how to generate HTML output with spans that mark addition, deletion, and modification.

The view of the differences should be shown in-line, and not side-by-side. Since the main use case is to see what is added and removed between different versions - and not merging or creating patches - it is more suitable to show the changes in-line.

Example output:

A diff example

The CSS class names should be visualDiffRemoved, visualDiffAdded.

Example HTML output:

    Today, a <span class="visualDiffRemoved">generation</span> 
    <span class="visualDiffAdded">pythonista</span> raised in 
    the shadows of the Cold War assumes 
    <span class="visualDiffRemoved">new</span> responsibilities 
    in a world warmed by the sunshine of
    <span class="visualDiffAdded">spam and</span> freedom

To select items to be compared, you use folder_contents, with the existing paradigm from the "Actions on search results" PLIP. The interface will be like this:

Selecting versions to compare

6. Deliverables

  • Short, concise documentation on how to use.
  • Unit tests.
  • Localization.

7. Risk Factors

Dependency on PLIP 18 - Actions on Search Results.

8. Time line

This implementation is a estimated to about 2 developer days.

9. Participants

Riccardo Lemmi, Reflab
Main development.
Alexander Limi, Plone Solutions
Quality assurance and user interface design.


Powered by Plone

This site conforms to the following standards: