Skip to content

Commit

Permalink
Merge pull request #2 from rtfpessoa/cleaning
Browse files Browse the repository at this point in the history
clean the readme and template
  • Loading branch information
Rodrigo Fernandes committed Jul 19, 2015
2 parents 336da58 + 784c75f commit 314a65e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
36 changes: 24 additions & 12 deletions README.md
@@ -1,10 +1,6 @@
# Diff to Html Node Module (CLI) by [rtfpessoa](https://github.com/rtfpessoa)
# Diff to Html CLI by [rtfpessoa](https://github.com/rtfpessoa)

Diff to Html generates pretty HTML diffs.

### Inspiration

This project is just a CLI for [diff2html-nodejs](https://github.com/rtfpessoa/diff2html-nodejs).
Diff to Html generates pretty HTML diffs from git diff output in your terminal

## Features

Expand All @@ -16,17 +12,23 @@ This project is just a CLI for [diff2html-nodejs](https://github.com/rtfpessoa/d

* GitHub like style

* Code syntax highlight

## Online Example

> Go to [Diff2HTML](http://rtfpessoa.github.io/diff2html/)
## Other Distributions
## Distributions

* [WebJar](http://www.webjars.org/)

* Manually download and import [diff2html.js](https://github.com/rtfpessoa/diff2html) into your page
* [Node Module](https://www.npmjs.org/package/diff2html)

* [Bower Package](http://bower.io/search/?q=diff2html)

* [Node CLI](https://www.npmjs.org/package/diff2html-cli)

* Import Node library [diff2html-nodejs](https://github.com/rtfpessoa/diff2html-nodejs) into your package.json
* Manually download and import `rtfpessoa/diff2html/dist/diff2html.min.js` into your page

## Setup

Expand All @@ -47,14 +49,24 @@ This project is just a CLI for [diff2html-nodejs](https://github.com/rtfpessoa/d
-s, --side Side by Side diff.
-j, --json Export diff in json format.

## Contribution
Example:

All contributions are welcome.
diff2html -p -l "HEAD~1"

To contribute just send a pull request with your feature,fix,... and it will be reviewed asap.
> NOTE: notice the " in the example
## Contributions

All the contributions are welcome.

To contribute just send a pull request with your changes and I will review it asap.

## License

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

## Thanks

This project is inspired in [pretty-diff](https://github.com/scottgonzalez/pretty-diff) by [Scott González](https://github.com/scottgonzalez).

---
21 changes: 11 additions & 10 deletions dist/template.html
Expand Up @@ -12,21 +12,22 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/github.min.css">
<link rel="stylesheet" type="text/css" href="{{css}}">

<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/languages/scala.min.js"></script>
<script>
$(document).ready(function () {
var allFileLanguages = $(".d2h-file-wrapper").map(function (i, file) {
return $(file).data("lang");
document.addEventListener("DOMContentLoaded", function () {
// collect all the distinct languages in the HTML
var distinctLanguages = [];
[].forEach.call(document.getElementsByClassName("d2h-file-wrapper"), function (file) {
distinctLanguages.indexOf(file.dataset.lang) === -1 && distinctLanguages.push(file.dataset.lang);
});
var distinctLanguages = allFileLanguages.filter(function (i, v) {
return $.inArray(v, allFileLanguages) == i;
});
hljs.configure({languages: distinctLanguages.toArray()});

var code = $(".d2h-code-line-ctn");
code.map(function (i, line) {
// pass the languages to the highlightjs plugin
hljs.configure({languages: distinctLanguages});

// collect all the code lines and execute the highlight on them
var codeLines = document.getElementsByClassName("d2h-code-line-ctn");
[].forEach.call(codeLines, function (line) {
hljs.highlightBlock(line);
});
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
@@ -1,8 +1,8 @@
{
"name": "diff2html-cli",
"version": "0.2.4",
"version": "0.2.4-1",

"homepage": "https://www.github.com/rtfpessoa/diff2html-nodejs-cli",
"homepage": "https://www.github.com/rtfpessoa/diff2html-cli",
"description": "Fast Diff to colorized HTML",
"keywords": [
"git",
Expand All @@ -29,11 +29,11 @@

"repository": {
"type": "git",
"url": "https://www.github.com/rtfpessoa/diff2html-nodejs-cli.git"
"url": "https://www.github.com/rtfpessoa/diff2html-cli.git"
},

"bugs": {
"url": "https://www.github.com/rtfpessoa/diff2html-nodejs-cli/issues"
"url": "https://www.github.com/rtfpessoa/diff2html-cli/issues"
},

"engines": {
Expand Down

0 comments on commit 314a65e

Please sign in to comment.