{"id":18064494,"url":"https://github.com/archonic/ruby_html_tree_differ","last_synced_at":"2026-01-18T23:01:39.633Z","repository":{"id":66279490,"uuid":"146673926","full_name":"archonic/ruby_html_tree_differ","owner":"archonic","description":"Ruby wrapper for the Python library html-tree-diff.","archived":false,"fork":false,"pushed_at":"2019-04-25T17:16:27.000Z","size":178,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T14:13:55.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/archonic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-30T00:24:42.000Z","updated_at":"2019-04-25T17:16:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"d81090f4-855a-47b8-aece-71ad1031a8f6","html_url":"https://github.com/archonic/ruby_html_tree_differ","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/archonic/ruby_html_tree_differ","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archonic%2Fruby_html_tree_differ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archonic%2Fruby_html_tree_differ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archonic%2Fruby_html_tree_differ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archonic%2Fruby_html_tree_differ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archonic","download_url":"https://codeload.github.com/archonic/ruby_html_tree_differ/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archonic%2Fruby_html_tree_differ/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28553055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T06:06:34.891Z","updated_at":"2026-01-18T23:01:39.617Z","avatar_url":"https://github.com/archonic.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ruby_html_tree_differ\n\nShows the difference between two HTML documents, rendered to HTML. Relies on the [html-tree-diff](https://github.com/christian-oudard/htmltreediff/) python module and calls it using [pycall.rb](https://github.com/mrkn/pycall.rb).\n\n### Prerequisites\n\nYou must have python installed. You can set the python command (`python` or `python3`) with the ENV variable `PYTHON`. By default pycall checks for `python3`, then `python`. If your `RUBY_PLATFORM` is `x86_x64_linux` you should set the ENV variable `LIBPYTHON` to the output of `which python` or `which python3`. For me it was `/usr/bin/python3`. Check pycall's [finder.rb](https://github.com/mrkn/pycall.rb/blob/master/lib/pycall/libpython/finder.rb) if you have trouble.\n\n### Install\n\nGemfile:\n```\ngem \"ruby_html_tree_differ\"\n```\n\nOr:\n```\ngem install ruby_html_tree_differ\n```\n\n### Example\n\n```ruby\nrequire 'ruby_html_tree_differ'\n\ndiffer = RubyHtmlTreeDiffer.new\n\nold_doc = \u003c\u003cEOF\n\u003cp\u003eUnchanged paragraph.\u003c/p\u003e\n\u003cp\u003eAltered paragraph.\u003c/p\u003e\n\u003cp\u003eDeleted paragraph.\u003c/p\u003e\nEOF\n\nnew_doc = \u003c\u003cEOF\n\u003cp\u003eUnchanged paragraph.\u003c/p\u003e\n\u003cp\u003eAlterated paragraph.\u003c/p\u003e\nEOF\n\nprint differ.diff! old_doc, new_doc\n```\n\n```html\n\u003cp\u003eUnchanged paragraph.\u003c/p\u003e\n\u003cp\u003e\n  \u003cdel\u003eAltered\u003c/del\u003e\n  \u003cins\u003eAlterated\u003c/ins\u003e\n   paragraph.\n\u003c/p\u003e\n\u003cdel\u003e\n  \u003cp\u003eDeleted paragraph.\u003c/p\u003e\n\u003c/del\u003e\n```\n\nCheck test/test.rb for 2 benchmarks. Very long documents take a long time to process. If you are using this in a web application, you will want to calculate the diff in a background job and cache the result.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchonic%2Fruby_html_tree_differ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchonic%2Fruby_html_tree_differ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchonic%2Fruby_html_tree_differ/lists"}