sbrl / Pepperminty-Wiki

A wiki in a box
https://peppermint.mooncarrot.space/
Mozilla Public License 2.0
183 stars 22 forks source link

History: Compare revisions #79

Open sbrl opened 8 years ago

sbrl commented 8 years ago

Being able to compare revisions is an essential feature. This would be extremely useful for regulars of a wiki as they can quickly see what has changed.

sbrl commented 8 years ago

This is rather complicated. I'm not sure whether I'll be able to do it - I'll have to take a look.

sbrl commented 7 years ago

60 might have something useful that we can use do attempt this. We could send the raw page revision data for the 2 different revisions and then have some client side javascript render a unified diff.

RyanGreenup commented 4 years ago

I hardly know what I'm talking about here, but, this sounds a lot like what git already implements, granted not through the web UI but maybe setting up git integration #192 first and then looking at how WikiJS implements diffs would be insightful?

I quite like how WikiJS manages conflicts because it's familiar (it's essentially a git diff), so maybe have a look at how it's been implemented there.

sbrl commented 4 years ago

That's an interesting idea @RyanGreenup. The problem is that Pepperminty Wiki already has a page revision system (that's tied into the page index), and I don't want to reply on git integration to allow for comparing revisions. Since I last commented on this issue though I've now implemented an extra data system, so it's just a case of finding a lightweight PHP library (1 file) to do the job (I'm really reluctant to spawn any subprocesses because of the performance hit).

The other thing is that I'm very keen on implementing this server side, such that users with Javascript disabled or without javascript support (e.g. elinks) can still view the diffs.

Before, I wasn't able to use any libraries at all (the Parsedown parser was a special case). With the new system, I can include files in the main Pepperminty Wiki index.php at build time, allowing for limited library inclusion.