release: New major refactor of diff2html to Typescript
:breaking:
This commit is contained in:
parent
df4481fdbf
commit
fd1a13c1e2
4 changed files with 23 additions and 11 deletions
|
|
@ -10,16 +10,15 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Get next version
|
name: Get next version
|
||||||
command: |
|
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=master)"
|
||||||
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=FAKE-RELEASE-BRANCH-NAME)"
|
|
||||||
echo "Next version is ${NEXT_VERSION}"
|
echo "Next version is ${NEXT_VERSION}"
|
||||||
echo "${NEXT_VERSION}" > .version
|
echo "${NEXT_VERSION}" > .version
|
||||||
- run:
|
- run:
|
||||||
name: Get next npm tag name
|
name: Get next npm tag name
|
||||||
command: |
|
command: |
|
||||||
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
|
if [ "${CIRCLE_BRANCH}" = "master" ]; then
|
||||||
export PUBLISH_TAG="latest"
|
export PUBLISH_TAG="latest"
|
||||||
elif [ "${GITHUB_REF#refs/heads/}" = "next" ]; then
|
elif [ "${CIRCLE_BRANCH}" = "next" ]; then
|
||||||
export PUBLISH_TAG="next"
|
export PUBLISH_TAG="next"
|
||||||
else
|
else
|
||||||
export PUBLISH_TAG="pr"
|
export PUBLISH_TAG="pr"
|
||||||
|
|
|
||||||
18
README.md
18
README.md
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
[]() []()
|
[]() []()
|
||||||
[](https://www.npmjs.com/package/diff2html)
|
[](https://www.npmjs.com/package/diff2html)
|
||||||
[](#contributors-)
|
[](#contributors)
|
||||||
[](https://gitter.im/rtfpessoa/diff2html?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
[](https://gitter.im/rtfpessoa/diff2html?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||||
|
|
||||||
diff2html generates pretty HTML diffs from git diff or unified diff output.
|
diff2html generates pretty HTML diffs from git diff or unified diff output.
|
||||||
|
|
@ -25,13 +25,14 @@ diff2html generates pretty HTML diffs from git diff or unified diff output.
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Online Example](#online-example)
|
- [Online Example](#online-example)
|
||||||
- [Distributions](#distributions)
|
- [Distributions](#distributions)
|
||||||
|
- [Usage](#usage)
|
||||||
- [Diff2Html Usage](#diff2html-usage)
|
- [Diff2Html Usage](#diff2html-usage)
|
||||||
- [Diff2Html API](#diff2html-api)
|
- [Diff2Html API](#diff2html-api)
|
||||||
- [Diff2Html Configuration](#diff2html-configuration)
|
- [Diff2Html Configuration](#diff2html-configuration)
|
||||||
- [Diff2Html Browser](#diff2html-browser)
|
- [Diff2Html Browser](#diff2html-browser)
|
||||||
- [Diff2Html NPM / Node.js Library](#diff2html-npm--nodejs-library)
|
- [Diff2Html NPM / Node.js Library](#diff2html-npm--nodejs-library)
|
||||||
- [Diff2Html Examples](#diff2html-examples)
|
- [Diff2Html Examples](#diff2html-examples)
|
||||||
- [Diff2HtmlUI](#diff2htmlui)
|
- [Diff2HtmlUI Usage](#diff2htmlui-usage)
|
||||||
- [Diff2HtmlUI API](#diff2htmlui-api)
|
- [Diff2HtmlUI API](#diff2htmlui-api)
|
||||||
- [Diff2HtmlUI Configuration](#diff2htmlui-configuration)
|
- [Diff2HtmlUI Configuration](#diff2htmlui-configuration)
|
||||||
- [Diff2HtmlUI Browser](#diff2htmlui-browser)
|
- [Diff2HtmlUI Browser](#diff2htmlui-browser)
|
||||||
|
|
@ -101,6 +102,17 @@ diff2html generates pretty HTML diffs from git diff or unified diff output.
|
||||||
including a `highlight.js` implementation. You can use it without syntax highlight or by passing your own
|
including a `highlight.js` implementation. You can use it without syntax highlight or by passing your own
|
||||||
implementation with the languages you prefer
|
implementation with the languages you prefer
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Diff2Html can be used in various ways as listed in the [distributions](#distributions) section. The two main ways are:
|
||||||
|
|
||||||
|
- [Diff2Html](#diff2html-usage): using the parser and html generator directly from the library gives you complete
|
||||||
|
control about what you can do with the json or html generated.
|
||||||
|
- [Diff2HtmlUI](#diff2htmlui-usage): using this wrapper makes it easy to inject the html in the DOM and adds some nice
|
||||||
|
features to the diff, like syntax highlight.
|
||||||
|
|
||||||
|
Bellow you can find more details and exemples about each option.
|
||||||
|
|
||||||
## Diff2Html Usage
|
## Diff2Html Usage
|
||||||
|
|
||||||
To load correctly in the Browser you always need to include the stylesheet in the final HTML.
|
To load correctly in the Browser you always need to include the stylesheet in the final HTML.
|
||||||
|
|
@ -266,7 +278,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Diff2HtmlUI
|
## Diff2HtmlUI Usage
|
||||||
|
|
||||||
> Simple wrapper to ease simple tasks in the browser such as: code highlight and js effects
|
> Simple wrapper to ease simple tasks in the browser such as: code highlight and js effects
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,9 @@
|
||||||
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
|
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
|
||||||
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
|
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
|
||||||
"build:website": "rm -rf docs; webpack ---display-reasons --display-modules --mode production --config webpack.website.ts",
|
"build:website": "rm -rf docs; webpack ---display-reasons --display-modules --mode production --config webpack.website.ts",
|
||||||
"build:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
|
"gen": "yarn run gen:toc",
|
||||||
"build:toc": "yarn run build:toc-base README.md",
|
"gen:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
|
||||||
|
"gen:toc": "yarn run gen:toc-base README.md",
|
||||||
"test": "is-ci 'test:coverage' 'test:watch'",
|
"test": "is-ci 'test:coverage' 'test:watch'",
|
||||||
"test:coverage": "jest --coverage",
|
"test:coverage": "jest --coverage",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
|
|
@ -82,7 +83,7 @@
|
||||||
"git add"
|
"git add"
|
||||||
],
|
],
|
||||||
"README.md": [
|
"README.md": [
|
||||||
"yarn run build:toc-base",
|
"yarn run gen:toc-base",
|
||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
<a class="navbar-item" href="index.html#install">Getting Started</a>
|
<a class="navbar-item" href="index.html#install">Getting Started</a>
|
||||||
<a class="navbar-item" href="index.html#cli">CLI</a>
|
<a class="navbar-item" href="index.html#cli">CLI</a>
|
||||||
<a class="navbar-item" href="demo.html">Demo</a>
|
<a class="navbar-item" href="demo.html">Demo</a>
|
||||||
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html#how-to-use" target="_blank"
|
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html#usage" target="_blank"
|
||||||
rel="noopener" rel="noreferrer">Docs</a>
|
rel="noopener" rel="noreferrer">Docs</a>
|
||||||
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html/issues/new" target="_blank"
|
<a class="navbar-item" href="https://github.com/rtfpessoa/diff2html/issues/new" target="_blank"
|
||||||
rel="noopener" rel="noreferrer">Support</a>
|
rel="noopener" rel="noreferrer">Support</a>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue