Skip to content

Commit

Permalink
merge betterdoc branch
Browse files Browse the repository at this point in the history
  • Loading branch information
thefab committed Nov 15, 2015
1 parent 496008c commit 41f9688
Show file tree
Hide file tree
Showing 20 changed files with 422 additions and 243 deletions.
2 changes: 1 addition & 1 deletion doc-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r pip-requirements.txt

Sphinx==1.3.1
sphinxcontrib-napoleon==0.3.11
sphinx_rtd_theme==0.1.8
17 changes: 16 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -30,6 +30,7 @@ help:
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
Expand All @@ -45,6 +46,7 @@ help:
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*
Expand Down Expand Up @@ -89,6 +91,14 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/tornadis.qhc"

applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
Expand Down Expand Up @@ -166,6 +176,11 @@ doctest:
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

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

xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
Expand Down
10 changes: 10 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
API
===

.. toctree::

api_client
api_pubsub
api_pipeline
api_exceptions
api_connection
11 changes: 11 additions & 0 deletions docs/api_client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Client API
==========

.. automodule:: tornadis

.. autoclass:: Client
:members:
:inherited-members:
:show-inheritance:

.. automethod:: __init__
10 changes: 10 additions & 0 deletions docs/api_connection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Connection API
==============

Warning: this class is not public, it appears here just to document some
kwargs. Do not use directly.

.. automodule:: tornadis

.. autoclass:: Connection
:members: __init__
16 changes: 16 additions & 0 deletions docs/api_exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Exceptions
==========

.. automodule:: tornadis

.. autoclass:: TornadisException
:members:
:show-inheritance:

.. autoclass:: ConnectionError
:members:
:show-inheritance:

.. autoclass:: ClientError
:members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/api_pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Pipeline API
============

.. automodule:: tornadis

.. autoclass:: Pipeline
:members:
:show-inheritance:

.. automethod:: __init__
11 changes: 11 additions & 0 deletions docs/api_pubsub.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PubSubClient API
================

.. automodule:: tornadis

.. autoclass:: PubSubClient
:members:
:inherited-members:
:show-inheritance:

.. automethod:: __init__
67 changes: 50 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# tornadis documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 9 21:29:37 2014.
# sphinx-quickstart on Sat Aug 22 14:28:48 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
Expand All @@ -14,12 +14,13 @@

import sys
import os
import shlex
import sphinx_rtd_theme

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../tornadis'))

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

Expand All @@ -31,15 +32,16 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The encoding of source files.
Expand All @@ -50,20 +52,24 @@

# General information about the project.
project = u'tornadis'
copyright = u'2014-2015, Fabien MARTY'
copyright = u'2015, Fabien MARTY'
author = u'Fabien MARTY'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0'
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.0.1'
release = '0.6.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -99,20 +105,23 @@
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
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
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down Expand Up @@ -181,10 +190,23 @@
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
#html_search_language = 'en'

# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}

# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'tornadisdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand All @@ -196,13 +218,16 @@

# Additional stuff for the LaTeX preamble.
#'preamble': '',

# Latex figure (float) alignment
#'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'tornadis.tex', u'tornadis Documentation',
(master_doc, 'tornadis.tex', u'tornadis Documentation',
u'Fabien MARTY', 'manual'),
]

Expand Down Expand Up @@ -232,8 +257,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'tornadis', u'tornadis Documentation',
[u'Fabien MARTY'], 1)
(master_doc, 'tornadis', u'tornadis Documentation',
[author], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -246,8 +271,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'tornadis', u'tornadis Documentation',
u'Fabien MARTY', 'tornadis', 'One line description of project.',
(master_doc, 'tornadis', u'tornadis Documentation',
author, 'tornadis', 'One line description of project.',
'Miscellaneous'),
]

Expand All @@ -263,5 +288,13 @@
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

napoleon_google_docstring = True
napoleon_numpy_docstring = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = False
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = True
napoleon_use_param = False
napoleon_use_rtype = True

0 comments on commit 41f9688

Please sign in to comment.