Coder Social home page Coder Social logo

diff2html-cli's Introduction

diff2html-cli

Codacy Code Badge Codacy Coverage Badge Circle CI Dependency Status

npm David David

node npm npm Gitter

Diff to Html generates pretty HTML diffs from unified and git diff output in your terminal

Features

  • Unified diff and Git diff input

  • line-by-line and side-by-side diff

  • new and old line numbers

  • inserted and removed lines

  • GitHub like style

  • Code syntax highlight

  • Line similarity matching

Online Example

Go to Diff2HTML

Distributions

Setup

npm install -g diff2html-cli

Usage

Usage: diff2html [options] -- [diff args]

Options:
  -s, --style                       Output style   [choices: "line", "side"] [default: "line"]
  --sc, --synchronisedScroll        Synchronised horizontal scroll   [choices: "enabled", "disabled"] [default: "enabled"]
  --su, --summary                   Show files summary   [choices: "closed", "open", "hidden"] [default: "closed"]
  --lm, --matching                  Diff line matching type   [choices: "lines", "words", "none"] [default: "none"]
  --lmt, --matchWordsThreshold      Diff line matching word threshold   [default: "0.25"]
  --lmm, --matchingMaxComparisons   Diff line matching maximum line comparisons of a block of changes [default: 2500]
  -f, --format                      Output format   [choices: "html", "json"] [default: "html"]
  -d, --diff                        Diff style   [choices: "word", "char"] [default: "word"]
  -i, --input                       Diff input source   [choices: "file", "command", "stdin"] [default: "command"]
  -o, --output                      Output destination   [choices: "preview", "stdout"] [default: "preview"]
  -u, --diffy                       Upload to diffy.org   [choices: "browser", "pbcopy", "print"]
  -F, --file                        Send output to file (overrides output option)   [string]
  --version                         Show version number
  -h, --help                        Show help

Examples:
  diff2html -s line -f html -d word -i command -o preview -- -M HEAD~1
      -> diff last commit, line by line, word comparison between lines,previewed
         in the browser and input from git diff command
  diff2html -i file -- my-file-diff.diff
      -> reading the input from a file
  diff -u file1.txt file2.txt | diff2html -i stdin
      -> reading diff from stdin
  diff2html -f json -o stdout -- -M HEAD~1
      -> print json format to stdout
  diff2html -F my-pretty-diff.html -- -M HEAD~1
      ->  print to file

© 2014-2016 rtfpessoa
For support, check out https://github.com/rtfpessoa/diff2html-cli

NOTE: notice the -- in the examples

Contributions

This is a developer friendly project, all the contributions are welcome. To contribute just send a pull request with your changes following the guidelines described in CONTRIBUTING.md. I will try to review them as soon as possible.

License

Copyright 2014-2016 Rodrigo Fernandes. Released under the terms of the MIT license.

Thanks

This project is inspired in pretty-diff by Scott González.


diff2html-cli's People

Contributors

rtfpessoa avatar thatkookooguy avatar anri-asaturov avatar brendannee avatar jung-kim avatar

Watchers

Alex Yao avatar

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.