diff2html
Advanced tools
Comparing version 3.4.14 to 3.4.15
{ | ||
"name": "diff2html", | ||
"version": "3.4.14", | ||
"version": "3.4.15", | ||
"homepage": "https://diff2html.xyz", | ||
@@ -5,0 +5,0 @@ "description": "Fast Diff to colorized HTML", |
@@ -303,2 +303,37 @@ # diff2html | ||
#### StimulusJS with TypeScript | ||
```ts | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Diff2HtmlUI, Diff2HtmlUIConfig } from 'diff2html/lib/ui/js/diff2html-ui-slim.js'; | ||
// Requires `yarn add highlight.js` | ||
import 'highlight.js/styles/github.css'; | ||
import 'diff2html/bundles/css/diff2html.min.css'; | ||
export default class extends Controller { | ||
connect(): void { | ||
const diff2htmlUi = new Diff2HtmlUI(this.diffElement, this.unifiedDiff, this.diffConfiguration); | ||
diff2htmlUi.draw(); | ||
} | ||
get unifiedDiff(): string { | ||
return this.data.get('unifiedDiff') || ''; | ||
} | ||
get diffElement(): HTMLElement { | ||
return this.element as HTMLElement; | ||
} | ||
get diffConfiguration(): Diff2HtmlUIConfig { | ||
return { | ||
drawFileList: true, | ||
matching: 'lines', | ||
}; | ||
} | ||
} | ||
``` | ||
## Diff2Html Usage | ||
@@ -305,0 +340,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1866930
596