views:

60

answers:

1

Hi

I'm wondering how to implement highlighting of changes to user edited articles on a wiki style rails project. Since articles may be fairly lengthy I'd ideally like strikethrough and highlighting, similar to github and wikipedia for example. Despite searching around the net I've not really come up with much, apart from instiki which is a complete wiki application.

Thanks in advance for any advice.

+3  A: 

To implement in Rails, you should use the a version management gem such as vestal version. Ryan Bates did an excellent screen-cast on the subject. Once you get the versioning of articles, you will want to use the html-diff (or a similar library) to do the html output.

Kevin Sylvestre
Hi Kevin and thanks for your reply. I am using vestal versions as it happens. How best though how to compare two the two versions is what I'm trying to find. This seems fairly complex, the need for example to recognise whitespace and unchanged text following a preceding deletion etc. Do any plugins exist?
mark
See the post... The second part links to a library for this...
Kevin Sylvestre
Ah brilliant. I guess I left my browser open for a few minutes while replying and thus missed your edit. ;) Seriously though, that looks awesome, I'll go check it out.
mark
Glad to hear. Good luck!
Kevin Sylvestre
Hey that worked great, thanks Kevin.
mark