diff2HtmlCompare icon indicating copy to clipboard operation
diff2HtmlCompare copied to clipboard

future of diff2HtmlCompare / some feature requests

Open nnako opened this issue 7 years ago • 1 comments

Hi,

I really like your tool :grin:

Just some questions about the future and possible features. There are some features which jump into my mind, immediately, after having played with your tool:

  • text wrap in HTML output
    when a line of text is longer than the available line space, there should be an option to tell the HTML output to wrap the lines so that the frequent usage of the shift bar can be omitted.
  • highlight of change details
    currently, there is a change highlight for THE ENTIRE LINE, so the user has to look for the detailled change within the line and looses a lot of time doing it. The result screen looks as @aramay showed at the end of issue #5 . See this project for an illustration: https://github.com/yebrahim/pydiff .
  • alternative outputs
    currently, there is only an output to HTML in a two-document way. on the left the original text and on the right the changed text. Other output formats like a MARKDOWN-file or PLAIN-TEXT to the console would come handy when trying to use the tool in a tool chain.
  • one-file output version
    currently, there are TWO OUTPUTS, one on the left and one on the right of the results screen. Would it be possible to merge both (the deletions from the original file and the new content from the changed file) into ONE SINGLE output? thus, a kind of change protocol / history could easily be created which always shows the latest content combined with the last changes.

What do you think?

nnako avatar Apr 21 '18 13:04 nnako

Thanks for the feedback! In general I'm not making many changes to this repo, basically bug fixes but no real feature additions. I've been pretty busy with other projects and also haven't needed to use this tool since my last job. Though, here are my thoughts:

  • wrapping the html output makes sense, scrolling horizontally is always pretty awkward. Downside is that you'd have to track the wrapping in both left and right panes (both could wrap, or only one). The simplest way to to this is to probably scan the line length then place a <br> when appropriate, though I believe this gets a bit trickier with the <pre> tags already there.

  • I originally wanted to highlight changes within a line instead of the line itself... I think given the right info this would be just adding a trivial <span> element with some formatting. Though I don't remember if the character information is available within the DiffHtmlFormatter class... would take a bit of digging is all.

  • this tool had a pretty specific purpose: make an html output diffing two files. What your suggesting for "alternative outputs" would be a dramatic different (where we'd render a markdown doc and show the rendered differences, is this what you are suggesting?)

  • It would be nice to have a single output instead of two columns. I feel that there is a clever css/js way to achieve this, but probably not with how it is currently written. I think this would imply making an alternative DiffHtmlFormatter class that could combine these into a single column.

Again, I probably won't be doing any of these changes myself, however, I'd be happy to review and merge any PRs sent my way.

wagoodman avatar Apr 22 '18 00:04 wagoodman