diff --git a/.circleci/config.yml b/.circleci/config.yml
index 57f0f67..f02b047 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,62 +1,194 @@
-version: 2
+version: 2.1
-reference:
- build-common: &common-build
- working_directory: ~/diff2html-cli
- steps: &common-steps
+jobs:
+ checkout-and-version:
+ docker:
+ - image: codacy/git-version
+ working_directory: ~/workdir
+ steps:
- checkout
+ - run:
+ name: Get next version
+ command: |
+ # Hack: Set a unique fake name for the release branch to avoid releasing master as the new 3.x major release for now
+ export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=FAKE-RELEASE-BRANCH-NAME)"
+ echo "Next version is ${NEXT_VERSION}"
+ echo "${NEXT_VERSION}" > .version
+ - run:
+ name: Get next npm tag name
+ command: |
+ if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
+ export PUBLISH_TAG="latest"
+ elif [ "${GITHUB_REF#refs/heads/}" = "next" ]; then
+ export PUBLISH_TAG="next"
+ else
+ export PUBLISH_TAG="pr"
+ fi
+ echo "Next tag is ${PUBLISH_TAG}"
+ echo "${PUBLISH_TAG}" > .tag
+ - persist_to_workspace:
+ root: ~/workdir
+ paths:
+ - '*'
+
+ build-common: &common-build
+ docker:
+ - image: node
+ working_directory: ~/workdir
+ steps:
+ - attach_workspace:
+ at: ~/workdir
- restore_cache:
- key: dependency-cache-{{ checksum "yarn.lock" }}
- - run: yarn
+ key: yarn-cache-{{ checksum "yarn.lock" }}
+ - run:
+ name: Log environment setup
+ command: |
+ node -v
+ yarn -v
+ - run:
+ name: Install dependencies
+ command: yarn
- save_cache:
- key: dependency-cache-{{ checksum "yarn.lock" }}
+ key: yarn-cache-{{ checksum "yarn.lock" }}
paths:
- - ./node_modules
- - run: yarn run build
- - run: yarn run coverage
+ - /usr/local/share/.cache/yarn
+ - run: yarn run validate
+ - store_artifacts:
+ path: coverage
+ - store_test_results:
+ path: coverage
build-latest: &latest-build
- working_directory: ~/diff2html-cli
+ docker:
+ - image: node
+ working_directory: ~/workdir
steps:
- - checkout
+ - attach_workspace:
+ at: ~/workdir
- restore_cache:
- key: dependency-cache-{{ checksum "yarn.lock" }}
- - run: yarn
+ key: yarn-cache-{{ checksum "yarn.lock" }}
+ - run:
+ name: Log environment setup
+ command: |
+ node -v
+ yarn -v
+ - run:
+ name: Install dependencies
+ command: yarn
- save_cache:
- key: dependency-cache-{{ checksum "yarn.lock" }}
+ key: yarn-cache-{{ checksum "yarn.lock" }}
paths:
- - ./node_modules
- - run: yarn run test
- - run: yarn run lint
- - run: yarn run coverage
- - run: yarn run codacy
+ - /usr/local/share/.cache/yarn
+ - run: yarn run validate
+ - store_artifacts:
+ path: coverage
+ - store_test_results:
+ path: coverage
+ - run: yarn run coverage:push
+ - persist_to_workspace:
+ root: ~/workdir
+ paths:
+ - '*'
-jobs:
- build-node_8:
+ build-node-10:
<<: *common-build
docker:
- - image: node:8
+ - image: node:10
- build-node_10:
+ build-node-11:
<<: *common-build
docker:
- - image: node:10
+ - image: node:11
- build-node_11:
+ build-node-12:
<<: *common-build
docker:
- - image: node:11
+ - image: node:12
- build-node_12:
+ build-node-13:
<<: *latest-build
docker:
- - image: node:12
+ - image: node:13
+
+ publish_library:
+ docker:
+ - image: node:13
+ working_directory: ~/workdir
+ steps:
+ - attach_workspace:
+ at: ~/workdir
+ - run:
+ name: Configure Yarn version
+ command: |
+ yarn config set version-tag-prefix ""
+ yarn config set version-git-message "Release version %s"
+ - run:
+ name: Configure Git
+ command: |
+ git config user.email "circleci@users.noreply.github.com"
+ git config user.name "CircleCI"
+ - run:
+ name: Version package
+ command: |
+ # Update version in packages to publish
+ yarn version --non-interactive --new-version $(cat .version)
+ - run:
+ name: Setup npm credentials
+ command: |
+ rm -f .npmrc
+ touch .npmrc
+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
+ echo "registry=https://registry.npmjs.org/" >> .npmrc
+ echo "access=public" >> .npmrc
+ echo "save-exact=true" >> .npmrc
+ - run:
+ name: Publish npm package
+ command: |
+ # Publish package versions to npmjs.org
+ yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
+ - run:
+ name: Setup gpr credentials
+ command: |
+ rm -f .npmrc
+ touch .npmrc
+ echo "//npm.pkg.github.com/:_authToken=${GPR_AUTH_TOKEN}" >> .npmrc
+ echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
+ echo "access=public" >> .npmrc
+ echo "save-exact=true" >> .npmrc
+ - run:
+ name: Publish gpr package
+ command: |
+ # HACK: Override npm package name to be able to publish in GitHub
+ sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html-cli",/g' package.json
+ echo "Going to publish version $(cat .version) to GitHub"
+ yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
+ # HACK: Restore npm package name
+ sed -i 's/^ "name":.*/ "name": "diff2html-cli",/g' package.json
workflows:
- version: 2
- build:
+ validate-and-publish:
jobs:
- - build-node_8
- - build-node_10
- - build-node_11
- - build-node_12
+ - checkout-and-version
+ - build-node-10:
+ requires:
+ - checkout-and-version
+ - build-node-11:
+ requires:
+ - checkout-and-version
+ - build-node-12:
+ requires:
+ - checkout-and-version
+ - build-node-13:
+ requires:
+ - checkout-and-version
+ - publish_approval:
+ type: approval
+ requires:
+ - build-node-10
+ - build-node-11
+ - build-node-12
+ - build-node-13
+ - publish_library:
+ requires:
+ - publish_approval
+
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..3015a69
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,58 @@
+module.exports = {
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ },
+ env: {
+ browser: true,
+ es6: true,
+ node: true,
+ },
+ globals: {
+ Atomics: 'readonly',
+ SharedArrayBuffer: 'readonly',
+ document: 'readonly',
+ navigator: 'readonly',
+ window: 'readonly',
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/eslint-recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:json/recommended',
+ 'plugin:promise/recommended',
+ 'plugin:import/errors',
+ 'plugin:import/warnings',
+ 'plugin:import/typescript',
+ 'plugin:node/recommended',
+ 'plugin:sonarjs/recommended',
+ 'plugin:jest/recommended',
+ 'plugin:jest/style',
+ 'prettier',
+ 'prettier/@typescript-eslint',
+ 'prettier/babel',
+ ],
+ plugins: ['@typescript-eslint', 'json', 'promise', 'import', 'node', 'sonarjs', 'jest', 'optimize-regex'],
+ rules: {
+ // Enable
+ 'optimize-regex/optimize-regex': 'error',
+ // Hack: For some reason we need pass again the extensions
+ 'node/no-missing-import': [
+ 'error',
+ {
+ tryExtensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
+ },
+ ],
+ // Disable
+ // https://github.com/benmosher/eslint-plugin-import/issues/1446
+ 'import/named': 'off',
+ // We don't need this since we are using transpilation
+ 'node/no-unsupported-features/es-syntax': 'off',
+ 'no-process-exit': 'off',
+ // Too verbose
+ 'sonarjs/no-duplicate-string': 'off',
+ // Too verbose
+ 'sonarjs/cognitive-complexity': 'off',
+ },
+};
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 2ab5590..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaVersion": 2018,
- "sourceType": "module",
- "ecmaFeatures": {
- "experimentalObjectRestSpread": true,
- "jsx": true
- }
- },
- "env": {
- "es6": true,
- "node": true,
- "browser": true,
- "commonjs": true,
- "jquery": true,
- "phantomjs": true,
- "jasmine": true,
- "mocha": true,
- "amd": true,
- "worker": true,
- "qunit": true
- },
- "plugins": ["standard", "node", "import", "promise", "@typescript-eslint", "jest"],
- "globals": {
- "document": false,
- "navigator": false,
- "window": false
- },
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:jest/recommended",
- "plugin:promise/recommended",
- "standard",
- "plugin:prettier/recommended"
- ]
-}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index cb4942b..12cc386 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,31 +1,22 @@
---
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
----
+name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' ---**Describe the bug** A
+clear and concise description of what the bug is.
-**Describe the bug**
-A clear and concise description of what the bug is.
+**To Reproduce** Steps to reproduce the behavior:
-**To Reproduce**
-Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-**Expected behavior**
-A clear and concise description of what you expected to happen.
+**Expected behavior** A clear and concise description of what you expected to happen.
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
+**Screenshots** If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- - OS: [e.g. Windows, Linux, Mac]
- - Version [e.g. 22]
-**Additional context**
-Add any other context about the problem here.
+- OS: [e.g. Windows, Linux, Mac]
+- Version [e.g. 22]
+
+**Additional context** Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index bbcbbe7..dd53cd8 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,20 +1,12 @@
---
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' ---**Is your feature
+request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always
+frustrated when [...]
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
+**Describe the solution you'd like** A clear and concise description of what you want to happen.
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
+**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features
+you've considered.
-**Additional context**
-Add any other context or screenshots about the feature request here.
+**Additional context** Add any other context or screenshots about the feature request here.
diff --git a/.gitignore b/.gitignore
index e4ef476..0bbd19c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,8 @@
+# Eclipse
+.classpath
+.project
+.settings/
+
# Intellij
.idea/
*.iml
@@ -6,13 +11,22 @@
# Mac
.DS_Store
+# Maven
+log/
+target/
+
# Node
-/node_modules/
-/npm-debug.log
-/yarn-error.log
+node_modules/
+npm-debug.log
+yarn-error.log
# Coverage
-/coverage/
+coverage/
+
+# Bower
+bower_components/
+
+# Terraform
+/terraform/.terraform
-# Build
-/build/
+/lib/
diff --git a/.prettierrc.json b/.prettierrc.json
index 0a57730..9b887a9 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,9 +1,17 @@
{
- "tabWidth": 2,
+ "arrowParens": "avoid",
+ "bracketSpacing": true,
+ "htmlWhitespaceSensitivity": "css",
+ "insertPragma": false,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
"printWidth": 120,
- "useTabs": false,
+ "proseWrap": "always",
+ "quoteProps": "as-needed",
+ "requirePragma": false,
"semi": true,
- "trailingComma": "none",
- "bracketSpacing": true,
- "arrowParens": "always"
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "all",
+ "useTabs": false
}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index e0e6195..c995da3 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -2,75 +2,60 @@
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, sex characteristics, gender identity and expression,
-level of experience, education, socio-economic status, nationality, personal
-appearance, race, religion, or sexual identity and orientation.
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
+participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
+disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
+socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
-Examples of behavior that contributes to creating a positive environment
-include:
+Examples of behavior that contributes to creating a positive environment include:
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
-* The use of sexualized language or imagery and unwelcome sexual attention or
- advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
+appropriate and fair corrective action in response to any instances of unacceptable behavior.
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
+issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
+contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
+project or its community. Examples of representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed representative at an online or offline
+event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at rtfrodrigo [at] gmail [dot] com. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
+rtfrodrigo [at] gmail [dot] com. All complaints will be reviewed and investigated and will result in a response that is
+deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with
+regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
+repercussions as determined by other members of the project's leadership.
## Attribution
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
+https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
-For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
+For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3848296..cb80f58 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,29 +2,31 @@
### Main rules
-* Before you open a ticket or send a pull request, [search](https://github.com/rtfpessoa/diff2html-cli/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
+- Before you open a ticket or send a pull request, [search](https://github.com/rtfpessoa/diff2html-cli/issues) for
+ previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
-* If you're proposing a new feature, make sure you create an issue to let other contributors know what you are working on.
+- If you're proposing a new feature, make sure you create an issue to let other contributors know what you are working
+ on.
-* Before sending a pull request make sure your code is tested.
+- Before sending a pull request make sure your code is tested.
-* Before sending a pull request for a feature, be sure to run tests with `npm test`.
+- Before sending a pull request for a feature, be sure to run tests with `npm test`.
-* Use the same coding style as the rest of the codebase, most of the check can be performed with `npm run style`.
+- Use the same coding style as the rest of the codebase, most of the check can be performed with `npm run style`.
-* Use `git rebase` (not `git merge`) to sync your work from time to time with the master branch.
+- Use `git rebase` (not `git merge`) to sync your work from time to time with the master branch.
-* After creating your pull request make sure the build is passing on [CircleCI](https://circleci.com/gh/rtfpessoa/diff2html-cli)
-and that [Codacy](https://www.codacy.com/app/Codacy/diff2html-cli) is also confident in the code quality.
+- After creating your pull request make sure the build is passing on
+ [CircleCI](https://circleci.com/gh/rtfpessoa/diff2html-cli) and that
+ [Codacy](https://www.codacy.com/app/Codacy/diff2html-cli) is also confident in the code quality.
### Commit Style
-Writing good commit logs is important. A commit log should describe what changed and why.
-Follow these guidelines when writing one:
+Writing good commit logs is important. A commit log should describe what changed and why. Follow these guidelines when
+writing one:
-1. The first line should be 50 characters or less and contain a short
- description of the change prefixed with the name of the changed
- subsystem (e.g. "net: add localAddress and localPort to Socket").
+1. The first line should be 50 characters or less and contain a short description of the change prefixed with the name
+ of the changed subsystem (e.g. "net: add localAddress and localPort to Socket").
2. Keep the second line blank.
3. Wrap all other lines at 72 columns.
@@ -47,14 +49,11 @@ nicely even when it is indented.
By making a contribution to this project, I certify that:
-* (a) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license indicated
- in the file; or
-* (b) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source license
- and I have the right under that license to submit that work with
- modifications, whether created in whole or in part by me, under the
- same open source license (unless I am permitted to submit under a
- different license), as indicated in the file; or
-* (c) The contribution was provided directly to me by some other
- person who certified (a), (b) or (c) and I have not modified it.
+- (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source
+ license indicated in the file; or
+- (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate
+ open source license and I have the right under that license to submit that work with modifications, whether created in
+ whole or in part by me, under the same open source license (unless I am permitted to submit under a different
+ license), as indicated in the file; or
+- (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not
+ modified it.
diff --git a/README.md b/README.md
index 6982cf6..b55c463 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# diff2html-cli
-[](https://www.codacy.com/app/rtfpessoa/diff2html-cli?utm_source=github.com&utm_medium=referral&utm_content=rtfpessoa/diff2html-cli&utm_campaign=Badge_Grade)
+[](https://www.codacy.com/app/rtfpessoa/diff2html-cli?utm_source=github.com&utm_medium=referral&utm_content=rtfpessoa/diff2html-cli&utm_campaign=Badge_Grade)
[](https://www.codacy.com/app/rtfpessoa/diff2html-cli?utm_source=github.com&utm_medium=referral&utm_content=rtfpessoa/diff2html-cli&utm_campaign=Badge_Coverage)
[](https://circleci.com/gh/rtfpessoa/diff2html-cli)
@@ -8,28 +8,45 @@
[](https://david-dm.org/rtfpessoa/diff2html-cli)
[](https://david-dm.org/rtfpessoa/diff2html-cli)
-[]()
-[]()
+[]() []()
[](https://www.npmjs.com/package/diff2html-cli)
[](https://gitter.im/rtfpessoa/diff2html?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Diff to Html generates pretty HTML diffs from unified and git diff output in your terminal
+## Table of Contents
+
+
+
+- [Features](#features)
+- [Online Example](#online-example)
+- [Distributions](#distributions)
+- [Setup](#setup)
+- [Usage](#usage)
+ - [Custom HTML wrapper template](#custom-html-wrapper-template)
+ - [Examples:](#examples)
+- [Contributions](#contributions)
+- [Developing](#developing)
+- [License](#license)
+- [Thanks](#thanks)
+
+
+
## Features
-* Unified diff and Git diff input
+- Unified diff and Git diff input
-* `line-by-line` and `side-by-side` diff
+- `line-by-line` and `side-by-side` diff
-* new and old line numbers
+- new and old line numbers
-* inserted and removed lines
+- inserted and removed lines
-* GitHub like style
+- GitHub like style
-* Code syntax highlight
+- Code syntax highlight
-* Line similarity matching
+- Line similarity matching
## Online Example
@@ -37,15 +54,16 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you
## Distributions
-* [WebJar](http://www.webjars.org/)
+- [WebJar](http://www.webjars.org/)
-* [Node Module](https://www.npmjs.org/package/diff2html)
+- [Node Module](https://www.npmjs.org/package/diff2html)
-* [Bower Package](http://bower.io/search/?q=diff2html)
+- [Bower Package](http://bower.io/search/?q=diff2html)
-* [Node CLI](https://www.npmjs.org/package/diff2html-cli)
+- [Node CLI](https://www.npmjs.org/package/diff2html-cli)
-* Manually download and import [diff2html.min.js](https://raw.githubusercontent.com/rtfpessoa/diff2html/master/dist/diff2html.min.js) into your page
+- Manually download and import
+ [diff2html.min.js](https://raw.githubusercontent.com/rtfpessoa/diff2html/master/dist/diff2html.min.js) into your page
## Setup
@@ -55,33 +73,35 @@ Diff to Html generates pretty HTML diffs from unified and git diff output in you
Usage: diff2html [options] -- [diff args]
-| flag | alias | description | choices | default |
-| --- | --- | --- | --- | --- |
-| -s | --style | Output style | `line`, `side` | `line` |
-| --sc | --synchronisedScroll | Synchronised horizontal scroll | `true`, `false` | `true` |
-| --hc | --highlightCode | Highlight code | `true`, `false` | `true` |
-| --su | --summary | Show files summary | `closed`, `open`, `hidden` | `closed` |
-| --d | --diffStyle | Diff style | `word`, `char` | `word` |
-| --lm | --matching | Diff line matching type | `lines`, `words`, `none` | `none` |
-| --lmt | --matchWordsThreshold | Diff line matching word threshold | | `0.25` |
-| --lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | `2500` |
-| --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the `html` output format | _[string]_ |
-| -f | --format | Output format | `html`, `json` | `html` |
-| -i | --input | Diff input source | `file`, `command`, `stdin` | `command` |
-| -o | --output | Output destination | `preview`, `stdout` | `preview` |
-| -u | --diffy | Upload to diffy.org | `browser`, `pbcopy`, `print` | |
-| -F | --file | Send output to file (overrides output option) | _[string]_ | |
-| --ig | --ignore | Ignore particular files from the diff | _[string]_ | |
-| -v | --version | Show version number | | |
-| -h | --help | Show help | | |
+| flag | alias | description | choices | default |
+| ----- | ------------------------ | -------------------------------------------------------------------------- | ---------------------------- | --------- |
+| -s | --style | Output style | `line`, `side` | `line` |
+| --sc | --synchronisedScroll | Synchronised horizontal scroll | `true`, `false` | `true` |
+| --hc | --highlightCode | Highlight code | `true`, `false` | `true` |
+| --su | --summary | Show files summary | `closed`, `open`, `hidden` | `closed` |
+| --d | --diffStyle | Diff style | `word`, `char` | `word` |
+| --lm | --matching | Diff line matching type | `lines`, `words`, `none` | `none` |
+| --lmt | --matchWordsThreshold | Diff line matching word threshold | | `0.25` |
+| --lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | `2500` |
+| --hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the `html` output format | _[string]_ |
+| -f | --format | Output format | `html`, `json` | `html` |
+| -i | --input | Diff input source | `file`, `command`, `stdin` | `command` |
+| -o | --output | Output destination | `preview`, `stdout` | `preview` |
+| -u | --diffy | Upload to diffy.org | `browser`, `pbcopy`, `print` | |
+| -F | --file | Send output to file (overrides output option) | _[string]_ | |
+| --ig | --ignore | Ignore particular files from the diff | _[string]_ | |
+| -v | --version | Show version number | | |
+| -h | --help | Show help | | |
### Custom HTML wrapper template
-The template is a very based on a simple replace of several placeholders as coded https://github.com/rtfpessoa/diff2html-cli/blob/master/src/cli.ts#L40
+The template is a very based on a simple replace of several placeholders as coded
+https://github.com/rtfpessoa/diff2html-cli/blob/master/src/cli.ts#L40
-To provide a custom template you need to make sure you have the following comments and imports in your HTML, exactly as they are here:
+To provide a custom template you need to make sure you have the following comments and imports in your HTML, exactly as
+they are here:
-* Inside the `
` tag
+- Inside the `` tag
```
@@ -100,7 +120,7 @@ To provide a custom template you need to make sure you have the following commen
```
-* Inside the `` tag
+- Inside the `` tag
```