Open juliushaertl opened 1 year ago
We probably could use https://commonmark.thephpleague.com/2.4/customization/abstract-syntax-tree/ and try to walk over the output from two versions to generate some sort of diff.
https://github.com/swaggest/json-diff might be useful for this
https://codepen.io/benbowes/pen/pVaMpv could be interesting to show changes inline in the version preview of text.
Doesn't seem to be actively maintained though https://github.com/dfoverdx/htmldiff-js
Summarizing different approaches that we've checked:
When trying to summarize changes that happened since a file was last viewed or to compare the difference of versions in a overview we would need a way to extract the difference between two files in some structured way.
When brainstorming with @AndyScherzinger and @marcoambrosini today we came up with the following idea:
As a first step we'd need to:
If this works out fine we can align with the design team on how to further make use of this, some possible candidates:
For implementation we may want approach it in a flexible API approach so that apps could provide their own extractors for file types which could be text for markdown and a different implementation in richdocuments for office files, though that is something to still evaluate in further detail after the first feasibility exploration.