-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Sphinx-based documentation.
Details: - Added package 'sphinx' to dev-requirements.txt file. - Added Sphinx related targets to Makefile. - Changed default 'all' target in Makefile to 'help'. - Added missing .PHONY statements for virtual targets in Makefile. - Created docs subdirectory with Sphinx config file and main file. - Updated and/or rewrote all docstrings in ld package. - Applied docs comments from PR 57. - In README.md, removed the preliminary API documentation, improved it and referenced the generated API documentation instead.
- Loading branch information
1 parent
063f066
commit fd74599
Showing
8 changed files
with
1,237 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ __pycache__/ | |
/env/ | ||
/bin/ | ||
/build/ | ||
/build_docs/ | ||
/develop-eggs/ | ||
/dist/ | ||
/eggs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,122 @@ | ||
.PHONY: release install files test docs prepare publish | ||
|
||
all: | ||
@echo "make release - prepares a release and publishes it" | ||
@echo "make dev - prepares a development environment (includes tests)" | ||
@echo "make instdev - prepares a development environment (no tests)" | ||
@echo "make install - install on local system" | ||
@echo "make test - run tox" | ||
@echo "make publish - upload to pypi" | ||
# Name of this package | ||
PACKAGENAME = ld | ||
|
||
# Additional options for Sphinx | ||
SPHINXOPTS = -v | ||
|
||
# Paper format for the Sphinx LaTex/PDF builder. | ||
# Valid values: a4, letter | ||
SPHINXPAPER = a4 | ||
|
||
# Sphinx build subtree. | ||
SPHINXBUILDDIR = build_docs | ||
|
||
# Directory where conf.py is located | ||
SPHINXCONFDIR = docs | ||
|
||
# Directory where input files for Sphinx are located | ||
SPHINXSOURCEDIR = . | ||
|
||
# Sphinx build command (Use 'pip install sphinx' to get it) | ||
SPHINXBUILD = sphinx-build | ||
|
||
# Internal variables for Sphinx | ||
SPHINXPAPEROPT_a4 = -D latex_paper_size=a4 | ||
SPHINXPAPEROPT_letter = -D latex_paper_size=letter | ||
ALLSPHINXOPTS = -d $(SPHINXBUILDDIR)/doctrees -c $(SPHINXCONFDIR) \ | ||
$(SPHINXPAPEROPT_$(SPHINXPAPER)) $(SPHINXOPTS) \ | ||
$(SPHINXSOURCEDIR) | ||
|
||
.PHONY: help | ||
help: | ||
@echo 'Please use "make <target>" where <target> is one of' | ||
@echo " release - build a release and publish it" | ||
@echo " dev - prepare a development environment (includes tests)" | ||
@echo " instdev - prepare a development environment (no tests)" | ||
@echo " install - install into current Python environment" | ||
@echo " test - test from this directory using tox, including test coverage" | ||
@echo " publish - upload to PyPI" | ||
@echo " html - generate docs as standalone HTML files in: $(SPHINXBUILDDIR)/html" | ||
@echo " pdf - generate docs as PDF (via LaTeX) for paper format: $(SPHINXPAPER) in: $(SPHINXBUILDDIR)/pdf" | ||
@echo " man - generate docs as manual pages in: $(SPHINXBUILDDIR)/man" | ||
@echo " docchanges - generate an overview of all changed/added/deprecated items in docs" | ||
@echo " doclinkcheck - check all external links in docs for integrity" | ||
@echo " doccoverage - run coverage check of the documentation" | ||
@echo " clean - remove any temporary build products" | ||
@echo " clobber - remove any build products" | ||
|
||
.PHONY: release | ||
release: publish | ||
@echo "$@ done." | ||
|
||
.PHONY: dev | ||
dev: instdev test | ||
@echo "$@ done." | ||
|
||
.PHONY: instdev | ||
instdev: | ||
pip install -r dev-requirements.txt | ||
python setup.py develop | ||
@echo "$@ done." | ||
|
||
.PHONY: install | ||
install: | ||
python setup.py install | ||
@echo "$@ done." | ||
|
||
.PHONY: test | ||
test: | ||
sudo pip install 'tox>=1.7.2' | ||
tox | ||
@echo "$@ done." | ||
|
||
.PHONY: publish | ||
publish: | ||
python setup.py sdist upload | ||
@echo "$@ done; uploaded the ld package to PyPI." | ||
|
||
.PHONY: html | ||
html: | ||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html | ||
@echo "$@ done; the HTML pages are in $(SPHINXBUILDDIR)/html." | ||
|
||
.PHONY: pdf | ||
pdf: | ||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/pdf | ||
@echo "Running LaTeX files through pdflatex..." | ||
$(MAKE) -C $(SPHINXBUILDDIR)/pdf all-pdf | ||
@echo "$@ done; the PDF files are in $(SPHINXBUILDDIR)/pdf." | ||
|
||
.PHONY: man | ||
man: | ||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/man | ||
@echo "$@ done; the manual pages are in $(SPHINXBUILDDIR)/man." | ||
|
||
.PHONY: docchanges | ||
docchanges: | ||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/changes | ||
@echo | ||
@echo "$@ done; the doc changes overview file is in $(SPHINXBUILDDIR)/changes." | ||
|
||
.PHONY: doclinkcheck | ||
doclinkcheck: | ||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/linkcheck | ||
@echo | ||
@echo "$@ done; look for any errors in the above output " \ | ||
"or in $(SPHINXBUILDDIR)/linkcheck/output.txt." | ||
|
||
.PHONY: doccoverage | ||
doccoverage: | ||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/coverage | ||
@echo "$@ done; the doc coverage results are in $(SPHINXBUILDDIR)/coverage/python.txt." | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf build $(PACKAGENAME).egg-info | ||
@echo "$@ done." | ||
|
||
.PHONY: clobber | ||
clobber: clean | ||
rm -rf $(SPHINXBUILDDIR) | ||
@echo "$@ done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ coverage==3.7.1 | |
nose | ||
nose-cov | ||
testfixtures | ||
testtools | ||
testtools | ||
sphinx>=1.1 |
Oops, something went wrong.