Interesting revision control interface idea

You know you've been hacking too long when… you design bits of content management systems in your sleep.

What happened was, I woke up early this morning and remembered bits of a dream I'd been having. In the dream I was thinking about a way to present web pages stored in a revision control system using some special HTML elements that don't exist. Because the page contained (in these special elements) all the revision history, it was possible to display any previous version of the page really quickly.

Translating to reality, HTML does have the <ins> and <del> elements, and if we marked up insertions and deletions for each revision (distinguishing changes at different times with different values for the class attribute) then we really would have all the revision information in the page.

So a paragraph in which a spelling mistake was fixed in the third revision might be presented as follows:

<p>Here is an interesting way of presenting
 rev<del class="rev3">si</del><ins class="rev3">is</ins>ion
 controlled web pages.</p>

The interesting bit is that we could probably write some JavaScript to set CSS things on these elements. Hiding and showing the right ones should make the visible bits correspond to different revisions of the file. We could provide buttons to instantly switch, making it easy for non-techies to see what's changed in a page without reading diffs.

A first thought of the algorithm for deciding what to hide and what to show: to view revision n display all insertions and hide all deletions for revisions before n, and hide all insertions and show all deletions after n. You'd have to turn off the normal styling of the <ins> and <del> elements.

I'm not awake enough yet to know whether this would actually work. In particular, there are some tricky issues about nested insertions and deletions, and how display and hiding override each other.

< Giving up | File::stat has a serious bug in Perl 5.6.1 >

Miniblog

(nuggets of inanity)

Tuesday Apr 24th 2007, 16:54 »
Just took the annual web design survey that AListApart do. I don't realy consider myself to be a web designer, but I have been doing a lot of HTML and CSS lately.
Monday Apr 23rd 2007, 18:23 »
Strange, there appears to be a bare-knuckle boxing match going on in the field outside my flat. Wish they wouldn't make so much noise about it.
Thursday Mar 1st 2007, 18:47 »
“In its written form, Hebrew has no vowels, making it the ideal language for texting.”
—Said in jest on some Radio 4 programme just now.

Archive: 2007 · 2006 · 2005 · 2004
Feed