Git Product home page Git Product logo

visual-diff's Introduction

Visual HTML differ

Uses headless Chrome to screenshot given pages and generates an HTML GUI for visual comparison.

Setup

  • Obtain the chromedriver binary [1] and make sure it’s in your $PATH.

  • Install matching Chrome version.

    (If not sure, let the tool run and it’ll fail with a chromedriver error instructing you which version you need.)

  • Obtain this tool:

    git clone [email protected]:metanorma/visual-diff.git visual-diff
    cd visual-diff
    
  • Create a Python 2 virtual environment [2] with libraries needed:

    virtualenv diff-env
    source diff-env/bin/activate
    pip install -r requirements.txt
    
[1]https://chromedriver.chromium.org
[2]https://virtualenv.pypa.io/en/latest/

Usage

  1. With Python environment activated, run:

    python html_diff.py <path/to/old/document.html> <path/to/new/document.html> <path/to/diff/results/dir>
    
  2. Open <path/to/diff/results/dir>/<document>/index.html in your favorite browser to see a visual diff.

  3. Switch between old, new and diff layers, and adjust opacity as needed.

Why

Many Metanorma flavors offer deliverables formatted in compliance with corresponding organizations’ requirements.

During development (especially larger refactors), a visual diff helps avoid undesired accidental changes in styling that might break compliance.

Roadmap

  • Simplify testing responsive layouts [3]
  • Simplify running on CI pipelines for Metanorma flavor repos
[3]#1

visual-diff's People

Contributors

strogonoff avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visual-diff's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.