Skip to content

Instantly share code, notes, and snippets.

@kgaughan
Created August 22, 2013 16:00
Show Gist options
  • Save kgaughan/6309193 to your computer and use it in GitHub Desktop.
Save kgaughan/6309193 to your computer and use it in GitHub Desktop.
Sphinx makefile changes to aid with uploading to a PyPI-style documentation server. This creates a new target, 'upload', to build and upload documentation generated by Sphinx.
SPHINX_SERVER = https://pypidocs.example.com/
SPHINX_NAME = handbook
upload: clean html
@which zip 2>&1 >/dev/null || (echo "zip required."; exit 1)
@which curl 2>&1 >/dev/null || (echo "curl required."; exit 1)
@( \
echo "Uploading..."; \
cd $(BUILDDIR)/html; \
zip -9 --recurse-paths --quiet - . | \
curl --form ":action=doc_upload" \
--form "name=$(SPHINX_NAME)" \
--form "content=@-" \
$(SPHINX_SERVER) \
)
.PHONY: upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment