.draft
is a free cloud-based service that creates a PDF highlighting changes made to your TeX
file. It's integrated with GitHub so that when you push changes or create a pull request, .draft
will link to the PDF either by a commit comment or through the GitHub Integrations API.
In the spirit of supporting open science, .draft
will only work on public GitHub repositories.
[example gif showing how it works]
check out the stable branch if you want to roll your own
Live demo -- a link to a PR with this enabled.
Once you've set up .draft
to run on your repository, here's what happens:
-
GitHub will alert
.draft
when you push a commit or open a pull request -
.draft
will clone your repository -
Unless your manuscript file is specified in a
.draft.yml
file in your repository,.draft
will look for your LaTeX manuscript by finding the*.tex
file that has been edited most -
If the webhook was triggered by a pull request, the base (old) and head (new) versions of your manuscript are found by comparing branches. If the webhook was triggered by a commit, then by default the previous commit is considered the base. You can change this by specifying
[dd <sha/tag>]
in a commit message, and.draft
will treat the SHA/tag given as the base for comparison. -
A
latexdiff
is run against the base and head versions and a PDF is compiled that highlights the changes made -
.draft
comments back on the commit or pull request with a link to the compiled PDF
-
In the "Settings" area of your GitHub repository, go to "Webhooks & services" then click the "Add webhook" button.
-
Enter
https://dotdraft.herokuapp.com
as the Payload URL, select the "Send me everything" option, then click the green "Add webhook" button. -
That's it! Just commit a push to your repository or create a pull request, and
.draft
will do the rest.
The standard .draft
build will work for any public repository, but if you want to create your own then just follow the instructions in SETUP.md
Released under MIT license. For more information, see the LICENSE
file. Copyright 2016 Andy Casey.