Diff for Flarum
This extension adds a "post revision history" feature to your Flarum forum. I did this one for my personal Flarum project and decided to share it. It's in beta stage right now, means that you may lose your previous revisions with an update until the stable release.
Here are the screenshots:
- Based on jfcherng/php-diff repository (this one is forked from chrisboulton/php-diff since it's no longer maintained).
- Option for line (default), word and char level diffs.
- Two render modes including "Inline", "Side By Side".
- Option for tabular view with line numbers.
- Delete revisions.
Also, it won't load (and cache) anything until you click the "Edited" button so no need to worry about loading times.
You can check your php version by running
php -v and check if
iconv is installed by running
php --ri iconv (which should display
iconv support => enabled).
Use Bazaar or install manually:
composer require the-turk/flarum-diff
composer update the-turk/flarum-diff
php flarum migrate
php flarum cache:clear
Enable the extension, set the permissions and customize the display mode if you wish.
flarum/mentions support (it's so challanging with external libraries).
Rollback function? I don't know, it seems pretty useless to me since you can just copy and paste from your previous revisions. I might need to change the way of storing diffs into the database for this kind of functionality. Hit me with the suggestions on GitHub.