Skip to content

Commit

Permalink
Added more to the docs and included sphinx-apidoc in the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
jowr committed Jul 16, 2015
1 parent 6fc6762 commit 0787c05
Show file tree
Hide file tree
Showing 18 changed files with 277 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ output/*/index.html

# Sphinx
docs/_build
/maintain_repo.bat
/maintain_repo.bsh
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To get tox, just pip install it.

6. Submit a pull request through the GitHub website.

.. _Fork: https://github.com/Nekroze/jopy/fork
.. _Fork: https://github.com/jowr/jopy/fork

Pull Request Guidelines
-----------------------
Expand All @@ -94,7 +94,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy.
3. The pull request should work for Python 2.7, 3.3 and 3.4.
Check https://travis-ci.org/jowr/jopy
under pull requests for active pull requests or run the ``tox`` command and
make sure that the tests pass for all supported Python versions.
Expand Down
2 changes: 1 addition & 1 deletion dev/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

bas_pkgs = ["conda-env", "conda-build", "binstar", "binstar-build", "jinja2"]

cus_pkgs = ["numpy", "scipy", "matplotlib", "pandas"]
cus_pkgs = ["numpy", "scipy", "matplotlib", "pandas", "blaze"]
pip_cus_pkgs = ["coolprop", "texttable", "brewer2mpl","future"]

dev_pkgs = cus_pkgs + ["pip", "pyyaml", "nose", "sphinx", "jinja2"]
Expand Down
52 changes: 30 additions & 22 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ help:
clean:
rm -rf $(BUILDDIR)/*

html:
html: apidoc
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
dirhtml: apidoc
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
singlehtml: apidoc
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
pickle: apidoc
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
json: apidoc
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
htmlhelp: apidoc
$(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: apidoc
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
Expand All @@ -89,7 +89,7 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/complexity.qhc"

devhelp:
devhelp: apidoc
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
Expand All @@ -98,80 +98,88 @@ devhelp:
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/complexity"
@echo "# devhelp"

epub:
epub: apidoc
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
latex: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
latexpdf: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
latexpdfja: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
text: apidoc
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
man: apidoc
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
texinfo: apidoc
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
info: apidoc
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
gettext: apidoc
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
changes: apidoc
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
linkcheck: apidoc
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
doctest: apidoc
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

xml:
xml: apidoc
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
pseudoxml: apidoc
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

.PHONY: apidoc
apidoc:
pushd .. ; \
sphinx-apidoc -fM -o docs/code jopy ; \
popd
@echo
@echo "Build finished. Output of sphinx-apidoc is in docs/code."
7 changes: 7 additions & 0 deletions docs/code/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
==========
Source Code
==========

The package is documented by means of docstring with autodoc

.. include:: jopy.rst
20 changes: 20 additions & 0 deletions docs/code/jopy.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jopy.data package
=================

.. automodule:: jopy.data
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

jopy.data.sources module
------------------------

.. automodule:: jopy.data.sources
:members:
:undoc-members:
:show-inheritance:


20 changes: 20 additions & 0 deletions docs/code/jopy.recip.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jopy.recip package
==================

.. automodule:: jopy.recip
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

jopy.recip.mechanisms module
----------------------------

.. automodule:: jopy.recip.mechanisms
:members:
:undoc-members:
:show-inheritance:


29 changes: 29 additions & 0 deletions docs/code/jopy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
jopy package
============

.. automodule:: jopy
:members:
:undoc-members:
:show-inheritance:

Subpackages
-----------

.. toctree::

jopy.data
jopy.recip
jopy.styles

Submodules
----------

jopy.base module
----------------

.. automodule:: jopy.base
:members:
:undoc-members:
:show-inheritance:


20 changes: 20 additions & 0 deletions docs/code/jopy.styles.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jopy.styles package
===================

.. automodule:: jopy.styles
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

jopy.styles.mplib module
------------------------

.. automodule:: jopy.styles.mplib
:members:
:undoc-members:
:show-inheritance:


7 changes: 7 additions & 0 deletions docs/code/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jopy
====

.. toctree::
:maxdepth: 4

jopy
24 changes: 20 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,27 @@

import jopy

# -- Special RTD configuration -------------------------------------------------

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
from unittest.mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()
MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas', 'scipy', 'scipy.interpolate', 'matplotlib', 'matplotlib.pyplot']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)


# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# 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', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -100,7 +113,10 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -180,10 +196,10 @@

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
'papersize': 'a4paper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
'pointsize': '11pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
Expand Down
9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Contents:
contributing
authors
history
code/index

Feedback
========
Expand All @@ -25,3 +26,11 @@ at [email protected].

If you encounter any errors or problems with **Jorrit's Python Package**, please let me know!
Open an Issue at the GitHub http://github.com/jowr/jopy main repository.


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit 0787c05

Please sign in to comment.