Skip to content

HTML output for diffs#1

Open
jfehrle wants to merge 4 commits intodiffsfrom
html_diffs2
Open

HTML output for diffs#1
jfehrle wants to merge 4 commits intodiffsfrom
html_diffs2

Conversation

@jfehrle
Copy link
Copy Markdown
Owner

@jfehrle jfehrle commented Jun 8, 2018

Generate an HTML file with proof diffs. It is probably not general enough to be merged yet. Code is extracted from rocq-prover#6801 to allow for a good discussion of what this should be.

This is based on the jfehrle/coq/diffs branch, which hasn't been merged. Not sure if this this PR is useful as such or if I need to wait until diffs is merged (advice welcome).

jfehrle added 4 commits June 8, 2018 15:26
a) not explicitly setting the default value and
b) not repeating attributes that are already set.

Example (omitting escape character):
Old:  E : [92;49;22;23;24;27mev[39;49;22;23;24;27m [39;49;22;23;24;27mn[39;49;22;23;24;27m
New:  E : [92mev[0m n

(92 is bright green, the other codes set default attributes).
… CoqIDE.

Proof General requires minor changes to make the diffs visible, but this code
shouldn't break the existing version of PG.  Also provides an option to generate
diffs in HTML in a file.

Diffs are computed for the hypotheses and conclusion of the first goal between
the old and new proofs. Strings are split into tokens using the Coq lexer,
then the list of tokens are diffed using the Myers algorithm.  A fixup routine
(Pp_diff.shorten_diff_span) shortens the span of the diff result in some cases.

Diffs can be enabled with the Coq commmand "Set Diffs on|off|removed." or
"-diffs on|off|removed" on the OS command line.  The "on" option shows only the
new item with added text, while "removed" shows each modified item twice--once
with the old value showing removed text and once with the new value showing
added text.

The highlights use 4 tags to specify the color and underline/strikeout.
These are "diffs.added", "diffs.removed", "diffs.added.bg" and "diffs.removed.bg".
The first two are for added or removed text; the last two are for
unmodified parts of a modified item.

Diffs that span multiple strings in the Pp are tagged with "start.diff.*" and
"end.diff.*", but only on the first and last strings of the span.
(cherry picked from commit 096afff)
@jfehrle jfehrle force-pushed the diffs branch 4 times, most recently from b0672f9 to fca201d Compare June 10, 2018 23:51
@jfehrle jfehrle force-pushed the diffs branch 2 times, most recently from ca90aa1 to 6e2e2ed Compare June 16, 2018 23:38
@jfehrle jfehrle force-pushed the diffs branch 9 times, most recently from 2439864 to 2cf033a Compare July 5, 2018 18:59
@jfehrle jfehrle force-pushed the diffs branch 2 times, most recently from b166ae5 to 7a844ad Compare July 9, 2018 07:04
@jfehrle jfehrle force-pushed the diffs branch 4 times, most recently from a45adb6 to 97069f6 Compare July 24, 2018 03:17
jfehrle pushed a commit that referenced this pull request Jan 22, 2019
add some more material (preliminary provided in "tuto2" directory)
jfehrle added a commit that referenced this pull request Jan 23, 2020
jfehrle added a commit that referenced this pull request Jan 23, 2020
jfehrle added a commit that referenced this pull request Feb 14, 2020
jfehrle added a commit that referenced this pull request May 26, 2020
jfehrle added a commit that referenced this pull request May 26, 2020
jfehrle added a commit that referenced this pull request May 28, 2020
jfehrle added a commit that referenced this pull request May 28, 2020
jfehrle added a commit that referenced this pull request Jun 8, 2020
jfehrle added a commit that referenced this pull request Jun 24, 2020
jfehrle added a commit that referenced this pull request Jul 19, 2020
jfehrle added a commit that referenced this pull request Jul 22, 2020
jfehrle pushed a commit that referenced this pull request Aug 28, 2020
jfehrle added a commit that referenced this pull request Sep 13, 2020
jfehrle added a commit that referenced this pull request Sep 28, 2020
jfehrle added a commit that referenced this pull request Sep 28, 2020
jfehrle added a commit that referenced this pull request Sep 29, 2020
jfehrle added a commit that referenced this pull request Oct 7, 2020
jfehrle added a commit that referenced this pull request Oct 12, 2020
jfehrle added a commit that referenced this pull request Oct 14, 2020
jfehrle added a commit that referenced this pull request Oct 15, 2020
jfehrle added a commit that referenced this pull request Oct 17, 2020
jfehrle added a commit that referenced this pull request Oct 20, 2020
jfehrle added a commit that referenced this pull request Oct 27, 2020
jfehrle added a commit that referenced this pull request Nov 3, 2020
jfehrle added a commit that referenced this pull request Nov 5, 2020
jfehrle added a commit that referenced this pull request Nov 7, 2020
jfehrle added a commit that referenced this pull request Nov 10, 2020
jfehrle added a commit that referenced this pull request Nov 11, 2020
jfehrle added a commit that referenced this pull request Nov 16, 2020
jfehrle added a commit that referenced this pull request Nov 17, 2020
jfehrle added a commit that referenced this pull request Nov 20, 2020
jfehrle added a commit that referenced this pull request Nov 23, 2020
jfehrle added a commit that referenced this pull request Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant