create new tag
, view all tags

Diff Raw Rendering


In some cases, diff is more readable when rendered as raw text. For instance, if %SEARCH% is used, a large result is produced. But only the declaration of %SEARCH% is important to see. Topics like FeatureToDo or TWikiPatches or the like produce huge diff results cause of %SEARCH%. But the only thing you want to see is that there is a additional column or a different format or something. Similar is %INCLUDE% and may be many other TWiki variables.


A Solution may be that variables are not solved in diff at all. This would result to a "partially raw text", possibly hard to understand and also hard to implement. Why not optionally render the diff result completly as raw text? Users are familiar with the raw text anyway. And this is a very simple way to cope with revisions.

-- StefanSteinegger - 25 Aug 2004


perhaps both rendered and raw text could be output and one hidden using css with some javascript for toggling. Or each change section could contain a link to the raw text for that difference that could be displayed in a new window with a plain skin.

-- SamHasler - 25 Aug 2004

this should be qiote simple to add

I have a pre-rendered diff option - see http://twiki.org/cgi-bin/rdiff/Codev/DiffRawRendering?rev1=1.2&rev2=1.1&render=debug

-- SvenDowideit - 25 Aug 2004

We have the code already, used to compare the Beta and Production doc. Here is an example output:

-- /home/beta/data/TWiki/EmptyPlugin.txt   Sun Mar 21 00:08:09 2004
++ /home/production/data/TWiki/EmptyPlugin.txt   Sun Mar 21 02:57:36 2004
@@ -1,6 +1,6 @@
%META:TOPICINFO{author="PeterThoeny" date="1079856240" format="1.0" version="1.6"}%
%META:TOPICINFO{author="WillNorris" date="1079866325" format="1.0" version="1.8"}%
---+ Empty TWiki Plugin

This is an empty plugin you can use as a template to build your own %TWIKIWEB%.TWikiPlugins. This plugin does nothing, but is ready to be used.

To create your own plugin:
@@ -11,42 +11,43 @@

---++ Syntax Rules


---++ Plugin Settings
---++ Plugins Settings

Plugin settings are stored as preferences variables. To reference
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>EMPTYPLUGIN_SHORTDESCRIPTION%==
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, e.g., ==%<nop>EMPTYPLUGIN_SHORTDESCRIPTION%== and ==%<nop>EMPTYPLUGIN_EXAMPLE%==

   * One line description, is shown in the %TWIKIWEB%.TextFormattingRules topic:
   * One line description which is shown in the %TWIKIWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = This plugin does nothing, but can be used as a template for your own plugins.

   * Your own setting, i.e.:
   * Your own setting, for example:
      * Set EXAMPLE = got it!

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0

---++ Plugin Installation Instructions

   * This plugin is preinstalled, you do not need to install it.
   * This plugin is preinstalled; you do not need to install it.

---++ Plugin Info

| Plugin Author: | TWiki:Main.AndreaSterbini, TWiki:Main.PeterThoeny |
| Plugin Version: | 21 Mar 2003 |
| Plugin Version: | 21 Mar 2004 |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 21 Mar 2004: | Added afterSaveHandler |
| 14 Jul 2001: | Changed to plug&amp;play |
| 27 Feb 2001: | Initial version |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.0 |
| TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle 99%, %TWIKIWEB%.FormattedSearch 99%, %TOPIC% 99% |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% (TWiki:Plugins.%TOPIC%) |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev (TWiki:Plugins.%TOPIC%Dev) |

__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins, DefaultPlugin

-- TWiki:Main.AndreaSterbini - 27 Feb 2001 %BR%
-- TWiki:Main.PeterThoeny - 21 Mar 2004

Here is the code: twikiDocDiffHandler.txt. It could be merged into the TWiki diffs.

The question is how the user gets to the raw diff. One option is to offer some links or buttons on top of the diff screen:

Standard diff | Unified diff | Context diff | Raw diff

The currently active one could be disabled.

-- PeterThoeny - 26 Aug 2004

That's what I mean. The default diff rendering could be defined in the TWikiPreferences, WebPreferences or UserPreferences.

It could look like that:

This text was removed
This new text was added 

-- StefanSteinegger - 27 Aug 2004

I actually have the opposite problem: I display diffs in the TWikiReleaseTrackerPlugin and currently can only display them as raw diff output. I'd like to render these diffs in TWiki markup -- can someone please advise whether there is an entry point?

-- MartinCleaver - 28 Aug 2004

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2004-08-28 - MartinCleaver
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.