Sometimes, especially for documentation purposes, it might be necessary to show a unified diff as a HTML page.

As we will ditch Basic theme in OXID eShop version 4.7/5.0, we had to document how to convert a customized theme based on Basic if you want to update. Included, we wanted to deliver a visual diff of the categorylist.tpl file to show how the category tree was loaded before and how it will be loaded from the new version on.

I found out that neither my IDE nor any other diff tools I knew could export directly to HTML. After a while of searching I found this great bash script: diff2html

Unpack it and you will find just one single file. On Linux, it is pretty easy to use:

~$ ./diff2html file1.txt file2.txt > differences.html

There are several options as well as an own style sheet that can be used (open this file and have a look at it). But even the default results are looking absolutely suitable.

  1. oehly says:

    Habe mal ein PHP Script geschrieben was alle tpl Dateien “diffed” und dann html Files generiert. Ich überlege ob das als Modul Sinn macht ?

    Guss Frank

  2. Marco Steinhäuser says:

    Depends what shall be diff’ed. Actually tpl diffs are already provided as HTML in cumulative update packages, generated by deployer during the release process. Unfortunately, it cannot be used as a stand alone tool for other purposes.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">