{"id":16527740,"url":"https://github.com/benoitzugmeyer/diff-annotate","last_synced_at":"2025-03-03T05:14:24.303Z","repository":{"id":25215817,"uuid":"28639942","full_name":"BenoitZugmeyer/diff-annotate","owner":"BenoitZugmeyer","description":"Generate a HTML file from a diff file and some annotations.","archived":false,"fork":false,"pushed_at":"2016-04-10T11:20:35.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T16:25:15.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenoitZugmeyer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-30T17:51:55.000Z","updated_at":"2024-01-08T08:56:36.000Z","dependencies_parsed_at":"2022-08-23T23:50:20.003Z","dependency_job_id":null,"html_url":"https://github.com/BenoitZugmeyer/diff-annotate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenoitZugmeyer%2Fdiff-annotate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenoitZugmeyer%2Fdiff-annotate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenoitZugmeyer%2Fdiff-annotate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenoitZugmeyer%2Fdiff-annotate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenoitZugmeyer","download_url":"https://codeload.github.com/BenoitZugmeyer/diff-annotate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241610990,"owners_count":19990508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T17:36:37.868Z","updated_at":"2025-03-03T05:14:24.285Z","avatar_url":"https://github.com/BenoitZugmeyer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=============\ndiff-annotate\n=============\n\nGenerates a HTML file from a diff file and some annotations.\n\nExample\n=======\n\nWe'll take two files as an example: :code:`filea` and :code:`fileb`.\n\n.. code:: bash\n\n    $ diff -u filea fileb\n    --- filea       2014-12-30 18:39:18.682725526 +0100\n    +++ fileb       2014-12-30 18:39:30.212509006 +0100\n    @@ -1,5 +1,4 @@\n     foo\n     bar\n    -some line to remove\n    -this one too\n    +this is a new line\n     baz\n\nYou can start editing annotations with something like that (with a bash\ncompatible shell):\n\n.. code:: bash\n\n    $ diff-annotate \u003c(diff -u filea fileb) review.html\n\nA wild editor_ appears! Add something like :code:`\u003e Oh noes, you **should not**\nremove this line` below the line :code:`-some line to remove`.\n\nOnce saved, you can then see the result in your favorite browser:\n\n.. code:: bash\n\n    $ firefox review.html\n\n.. image:: example.png\n\nYou can edit annotations by reexecuting the same command (annotations are\nstored in the output file)\n\n.. code:: bash\n\n    $ diff-annotate \u003c(diff -u filea fileb) review.html\n\nOf course, this is not limited to the 'diff' command. diff-annotate should\nhandle any unified diff you give as first argument. For example, you can pass\na plain diff file:\n\n.. code:: bash\n\n    $ diff-annotate my_diff.diff review.html\n\nOr a :code:`git diff` command:\n\n.. code:: bash\n\n    $ diff-annotate \u003c(git diff -w HEAD^) review.html\n\nOr even a git commit with a message:\n\n.. code:: bash\n\n    $ diff-annotate \u003c(git show HEAD) review.html\n\nAnnotations syntax\n==================\n\nAll annotation lines should start with a 'greater than' character.\n\nComments are formated with `reStructuredText`_. Example:\n\n.. code::\n\n    \u003e This is a title\n    \u003e ===============\n    \u003e\n    \u003e * list item, *this is important*\n    \u003e * other item, **this is more important**\n    \u003e\n    \u003e `This \u003chttps://github.com\u003e`_ is a link to github.\n\nAnnotations should always be either:\n\n* below a diff source line\n\n* or at the very beginning of the diff file\n\nElsewhere, annotations won't be saved.\n\nInstallation\n============\n\nWith pip and python 3::\n\n    $ pip install https://github.com/BenoitZugmeyer/diff-annotate/archive/master.zip\n\n.. _reStructuredText: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html\n\nEditor\n======\n\nThe editor spawned is your default editor. You can change it to anything you\nlike by setting the :code:`EDITOR` environment variable in your :code:`.bashrc`\n(or whatever works for you). For example, to use sublime text::\n\n    $ echo 'export EDITOR=\"subl -w\"' \u003e\u003e ~/.bashrc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitzugmeyer%2Fdiff-annotate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitzugmeyer%2Fdiff-annotate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitzugmeyer%2Fdiff-annotate/lists"}