Skip to content

rattle/diffrenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiffRenderer

DiffRenderer creates pretty HTML diffs for text and bits of html documents.

Example Usage

#!/usr/bin/ruby

require 'rubygems'
require 'diffrenderer'

old_text = ['This was some text']
new_text = ['This is some text']
puts DiffRenderer.new(old_text, new_text).to_html

Generates :

<p>
This <span class="removed">was</span> <span class="added">is</span> some text
</p>

See the examples directory for more details.

Credits

Original code produced by Rattle (www.rattlecentral.com) with the help of Ashley Moran (github.com/ashleymoran/)

Gemified by robl (www.monkeyhelper.com)

Todo

  • Add some tests

  • Further documentation - description of process, multi-paragraph example

Copyright © 2009 Rattle www.rattlecentral.com. See LICENSE for details.

About

Takes two pieces of source text/html and creates a neato html diff output

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages