Generate API docs in sphinx.
authorJelmer Vernooij <jelmer@jelmer.uk>
Sun, 18 Nov 2018 19:02:04 +0000 (19:02 +0000)
committerJelmer Vernooij <jelmer@jelmer.uk>
Sun, 18 Nov 2018 19:02:04 +0000 (19:02 +0000)
Makefile
docs/Makefile
docs/api/index.txt [new file with mode: 0644]
docs/conf.py
docs/index.txt

index 0db4c0b6994b6901dc3bad00c8c68d58f3b07123..d0bdb3d235bf18d07806d51c35608f37da59108d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ PYFLAKES = pyflakes
 PEP8 = pep8
 FLAKE8 ?= flake8
 SETUP = $(PYTHON) setup.py
-PYDOCTOR ?= pydoctor
 TESTRUNNER ?= unittest
 RUNTEST = PYTHONHASHSEED=random PYTHONPATH=$(shell pwd)$(if $(PYTHONPATH),:$(PYTHONPATH),) $(PYTHON) -m $(TESTRUNNER) $(TEST_OPTIONS)
 COVERAGE = python3-coverage
@@ -12,15 +11,11 @@ DESTDIR=/
 
 all: build
 
-doc:: pydoctor
 doc:: sphinx
 
 sphinx::
        $(MAKE) -C docs html
 
-pydoctor::
-       $(PYDOCTOR) --make-html -c dulwich.cfg
-
 build::
        $(SETUP) build
        $(SETUP) build_ext -i
index 6a27ce67edb0916dc6fa463d6f475f1c29d67575..f78d2767639004fe213460f71488a1d7f968a859 100644 (file)
@@ -31,33 +31,36 @@ help:
 clean:
        -rm -rf $(BUILDDIR)/*
 
-html:
+apidocs:
+       sphinx-apidoc -feM -s txt -o api ../dulwich
+
+html: apidocs
        $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
        @echo
        @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
 
-dirhtml:
+dirhtml: apidocs
        $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
        @echo
        @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
 
-pickle:
+pickle: apidocs
        $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
        @echo
        @echo "Build finished; now you can process the pickle files."
 
-json:
+json: apidocs
        $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
        @echo
        @echo "Build finished; now you can process the JSON files."
 
-htmlhelp:
+htmlhelp: apidocs
        $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
        @echo
        @echo "Build finished; now you can run HTML Help Workshop with the" \
              ".hhp project file in $(BUILDDIR)/htmlhelp."
 
-qthelp:
+qthelp: apidocs
        $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
        @echo
        @echo "Build finished; now you can run "qcollectiongenerator" with the" \
@@ -66,14 +69,14 @@ qthelp:
        @echo "To view the help file:"
        @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/dulwich.qhc"
 
-latex:
+latex: apidocs
        $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
        @echo
        @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
        @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
              "run these through (pdf)latex."
 
-changes:
+changes: apidocs
        $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
        @echo
        @echo "The overview file is in $(BUILDDIR)/changes."
diff --git a/docs/api/index.txt b/docs/api/index.txt
new file mode 100644 (file)
index 0000000..355c3a1
--- /dev/null
@@ -0,0 +1,14 @@
+This is the API documentation for Dulwich.
+
+Module reference
+----------------
+
+.. toctree::
+    :maxdepth: 3
+
+    modules
+
+Indices:
+
+* :ref:`modindex`
+* :ref:`search`
index 9fef29e5734785cabb519ea2238326d58d568038..12c6270a92f9d33abeb50c5c76cd72f081d550b0 100644 (file)
@@ -26,7 +26,12 @@ dulwich = __import__('dulwich')
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
+extensions = [
+    'sphinx.ext.autodoc',
+    'sphinx.ext.ifconfig',
+    'sphinx.ext.intersphinx',
+    'sphinx_epytext',
+    ]
 try:
     import rst2pdf
     if rst2pdf.version >= '0.16':
@@ -51,7 +56,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'dulwich'
-copyright = u'2011, Jelmer Vernooij'
+copyright = u'2011-2018 Jelmer Vernooij'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
index 113fba3a690b3c767cd1b940ebdcaf1a75f7c28d..9ea01b0f845fa9223aac6bb92ea4e95c491f6f76 100644 (file)
@@ -12,7 +12,6 @@ Overview
 Documentation
 =============
 
-
 .. toctree::
     :maxdepth: 2
 
@@ -21,6 +20,8 @@ Documentation
 
     tutorial/index
 
+    api/index
+
 
 Changelog
 =========