Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

See if it exists before I reinvent it

by mpersico (Scribe)
on Aug 29, 2012 at 20:59 UTC ( #990569=perlquestion: print w/replies, xml ) Need Help??
mpersico has asked for the wisdom of the Perl Monks concerning the following question:

I have found numerous modules that will do a text diff on two objects (strings, files, etc) and then produce HTML. However the HTML-izer function is typically not part of the public API. Does any one know if there is module that takes an already produced diff and converts that to HTML before I go and code one up (I don't even know what namespace that should live in...) Thank you.

Replies are listed 'Best First'.
Re: See if it exists before I reinvent it
by bart (Canon) on Aug 29, 2012 at 21:11 UTC
    It could be that it exists. Maybe not in the exact form you're imagining, but ...

    I found these:

    1. colordiff, a Perl script to colorize diff output (but in ANSI console)
    2. Convert diff output to colorized HTML, a bash script

    As for namespace, I'd think in the direction of "Text::Diff::Colorized::HTML", which is quite a mouthful.

      I am actually using the code at your #2 in a pipeline. That is going to be my jumping off point for he module. I'll check out colordiff also. Thanks.
Re: See if it exists before I reinvent it (.patch .diff syntax highlighter)
by Anonymous Monk on Aug 29, 2012 at 23:08 UTC
      Yes, I have a unified diff comming out of svn and I want to convert that to html. All of the modules I saw would have been perfect IF they let me plug in my own diff command. But they were all set up to actually do the diff themselves. Ill check the Syntax::Highlight* modules. Thanks.
Re: See if it exists before I reinvent it
by influx (Beadle) on Aug 29, 2012 at 22:31 UTC
    If you have an idea for a module, would like criticisms or namespace suggestions you could try - I think it's still in its infancy, but I like the idea of it. It does what it says on the tin: prepan it, before you CPAN it. I should trademark that.. - what a fantastic idea. Will do! Thank you

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://990569]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2018-06-23 12:54 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.