{# vim: set et ts=8 sts=4 sw=4 ai: #} {#- Render the rows of otterwiki.util.diff_side_by_side_html() as a two column diff. The content of a call block is placed in the . color_a and color_b mark the changed lines of each side with a colored border, e.g. by the revision they belong to. Partially changed lines are marked by their line number, only the changed words are colored. -#} {% macro diff_side_by_side(rows, id=none, color_a=none, color_b=none) -%} {%- if caller is defined %} {{ caller() }} {%- endif %} {%- for row in rows %} {%- if row.hunk %} {%- else %} {%- for cell, color in [(row.left, color_a), (row.right, color_b)] %} {%- if cell %} {%- if color and not row.context %} {%- else %} {%- endif %} {%- if row.context %} {%- else %} {%- endif %} {%- else %} {%- endif %} {%- endfor %} {%- endif -%} {%- endfor %}
{{ row.hunk }}{{ cell.number }}{{ cell.number }}
{{ cell.html|safe }}
{{ cell.html|safe }}
{%- endmacro %}