- Description - Allow document-oriented content types to be compared, mostly between versions.
- PLIP - 19
- Proposer - Alexander Limi
- Seconder -
- Status - Draft
- Time line
- Short-hand for "difference" - a very common command on Unix to analyze and show the differences between two versions of a file.
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.
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.
A diffing mechanism should be implemented, that allows the contributor to compare one content type to another one of the same type.
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.
The CSS class names should be
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:
- Short, concise documentation on how to use.
- Unit tests.
Dependency on PLIP 18 - Actions on Search Results.
This implementation is a estimated to about 2 developer days.