Availability |
Odoo Online
Odoo.sh
On Premise
|
Technical Name |
web_diff2html |
License | LGPL-3 |
Website | https://github.com/andriusl/ |
Diff To HTML
Converts diff output of a field value to prettified HTML. (e.g. as seen on github, bitbucket etc.).
This module uses diff2html as a base library to generate HTML diff.
Usage:
- Field must be of HTML type.
- Set widget="diff2html" on field where it is defined in a form view.
- You can provide optional configuration from XML view (on field). For example:
<field name="diff"
widget="diff2html" data-diff2html="{'options': {'inputFormat': 'diff', 'showFiles': true}, 'extra': {'highlightCode': true, 'fileListCloseable': true, 'fileListCloseableDefault': true}}"/>
- There are two config parts: options and extra. For all options and what they do, look here. For extra part, there are currently two implementations: highlightCode and fileListCloseable (with optional key fileListCloseableDefault to specify if files are hidden or showed on default.). If you need some additional effect on HTML output that diff2html library provides, then you need to extend function apply_extra.
This a sample diff2html implementation in Odoo using this widget:
Contributors
- Andrius Laukavičius
Please log in to comment on this module