Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add events DIFF_RENDER and DIFF_TYPES to add new diff renderer via plugin #3547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterfromearth
Copy link
Contributor

i would like to add a plugin which adds a new diff renderer using this external html renderer https://github.com/caxy/php-htmldiff

Therefore I need two more events

  • DIFF_TYPES (used to add a new type to the dropdown list)
  • DIFF_RENDER (used to output the new renderer)

You can find the plugin which uses the new events here https://github.com/peterfromearth/dokuwiki-plugin-htmldiff

@Klap-in
Copy link
Collaborator

Klap-in commented Nov 13, 2021

There is a big refactor of the code under way of the revision en diff UI parts. I guess it is most practical to merge this after #3361

@peterfromearth
Copy link
Contributor Author

@Klap-in thanks for the hint. I adopted the changes to be compatible with the pullRequest in this branch https://github.com/peterfromearth/dokuwiki/tree/revisionHandle3_event_diff (Diff: peterfromearth@f98e218?w=1)

Currently its not very optimal to insert a new renderer. Maybe you have some ideas to improve it.

@Klap-in
Copy link
Collaborator

Klap-in commented Nov 14, 2021

Your proposal with two events, and the second one that wraps the default html output makes sense for me, but I assumed that you build a complete new diff view.
I react on that commit here:
peterfromearth@f98e218

I’m wondering if wrapping only the final step is really practical. I think it makes it not possible to change the header, so less flexible. 1c9523b

Replacing complete output html makes task of the plugin a bit bigger, and more flexible, the little bit of code duplication is fine for me. So I prefer peterfromearth@f98e218

@Klap-in
Copy link
Collaborator

Klap-in commented Nov 14, 2021

Currently its not very optimal to insert a new renderer. Maybe you have some ideas to improve it.

you means this part: https://github.com/peterfromearth/dokuwiki-plugin-htmldiff/blob/f50d93986106138db15466413278ae3139264883/action.php#L66-L67
The use of p_wiki_xhtml() is fine here so far I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants