woolfg / dokuwiki-plugin-gitbacked

Plugin for DokuWiki to store/sync files and media with a git repo
GNU General Public License v2.0
74 stars 26 forks source link

Add support for the publish plugin #75

Open ochurlaud opened 2 years ago

ochurlaud commented 2 years ago

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.

woolfg commented 2 years ago

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?

ochurlaud commented 2 years ago

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 commented 2 years ago

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

woolfg commented 2 years ago

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 ?

ochurlaud commented 2 years ago

very good idea. I'll propose something :)