Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

See if it exists before I reinvent it

by mpersico (Beadle)
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.

Comment on See if it exists before I reinvent it
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
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 http://prepan.org - 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..
      http://perpan.org - what a fantastic idea. Will do! Thank you
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://990569]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-09-20 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (153 votes), past polls