dokuwiki-plugin-gitbacked icon indicating copy to clipboard operation
dokuwiki-plugin-gitbacked copied to clipboard

Add support for the publish plugin

Open ochurlaud opened this issue 2 years ago • 5 comments

Whenever a page is validated, add a specific empty commit to keep track of the validation.

I already have a patch to implement that. If you think it's a legitimate feature, please tell me and i'll propose it.

ochurlaud avatar Mar 19 '22 21:03 ochurlaud

thank @ochurlaud for the proposal, can you please describe it a bit more in details what is does and for what use case it is needed?

woolfg avatar Mar 21 '22 10:03 woolfg

The need: If i use gitbacked, it is because I want all the relevant information of my wiki to be stored in git. Whenever I validate a page (it's what the plugin is for: having draft pages, and promoting some pages as "validated").

What it would do: each time someone promotes a page as "validated", an empty commit on the associated page is added.

How to implement it ? Register to the "PLUGIN_PUBLISH_APPROVE" event, and whenever it received, commit the page (empty commit) with a given commit message (such as "Page approved by $user: $page_id").

ochurlaud avatar Mar 21 '22 20:03 ochurlaud

When all that is done, my next step would be to create a script that recreates the dokuwiki history based on the git history. But that is for another issue :P

ochurlaud avatar Mar 21 '22 20:03 ochurlaud

ok, I see. maybe we could build a more flexible system which can be used for other plugins as well. so that we e.g. can config it somewhere what events should lead to what commit message. what do you think @ochurlaud ?

woolfg avatar Mar 22 '22 10:03 woolfg

very good idea. I'll propose something :)

ochurlaud avatar Mar 23 '22 07:03 ochurlaud