Merge pull request #316 from sontek/add_docs_to_tox

Allow better usage of docs locally.
This commit is contained in:
Dana Powers
2015-02-10 16:24:42 -08:00
9 changed files with 230 additions and 70 deletions

View File

@@ -1,64 +0,0 @@
API Reference
=============
kafka
-----
.. automodule:: kafka.client
:members:
.. automodule:: kafka.codec
:members:
.. automodule:: kafka.common
:members:
.. automodule:: kafka.conn
:members:
.. automodule:: kafka.context
:members:
.. automodule:: kafka.protocol
:members:
.. automodule:: kafka.util
:members:
kafka.consumer
--------------
.. automodule:: kafka.consumer.base
:members:
.. automodule:: kafka.consumer.kafka
:members:
.. automodule:: kafka.consumer.multiprocess
:members:
.. automodule:: kafka.consumer.simple
:members:
kafka.partitioner
-----------------
.. automodule:: kafka.partitioner.base
:members:
.. automodule:: kafka.partitioner.hashed
:members:
.. automodule:: kafka.partitioner.roundrobin
:members:
kafka.producer
--------------
.. automodule:: kafka.producer.base
:members:
.. automodule:: kafka.producer.keyed
:members:
.. automodule:: kafka.producer.simple
:members:

View File

@@ -0,0 +1,46 @@
kafka.consumer package
======================
Submodules
----------
kafka.consumer.base module
--------------------------
.. automodule:: kafka.consumer.base
:members:
:undoc-members:
:show-inheritance:
kafka.consumer.kafka module
---------------------------
.. automodule:: kafka.consumer.kafka
:members:
:undoc-members:
:show-inheritance:
kafka.consumer.multiprocess module
----------------------------------
.. automodule:: kafka.consumer.multiprocess
:members:
:undoc-members:
:show-inheritance:
kafka.consumer.simple module
----------------------------
.. automodule:: kafka.consumer.simple
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: kafka.consumer
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,38 @@
kafka.partitioner package
=========================
Submodules
----------
kafka.partitioner.base module
-----------------------------
.. automodule:: kafka.partitioner.base
:members:
:undoc-members:
:show-inheritance:
kafka.partitioner.hashed module
-------------------------------
.. automodule:: kafka.partitioner.hashed
:members:
:undoc-members:
:show-inheritance:
kafka.partitioner.roundrobin module
-----------------------------------
.. automodule:: kafka.partitioner.roundrobin
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: kafka.partitioner
:members:
:undoc-members:
:show-inheritance:

View File

@@ -0,0 +1,38 @@
kafka.producer package
======================
Submodules
----------
kafka.producer.base module
--------------------------
.. automodule:: kafka.producer.base
:members:
:undoc-members:
:show-inheritance:
kafka.producer.keyed module
---------------------------
.. automodule:: kafka.producer.keyed
:members:
:undoc-members:
:show-inheritance:
kafka.producer.simple module
----------------------------
.. automodule:: kafka.producer.simple
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: kafka.producer
:members:
:undoc-members:
:show-inheritance:

79
docs/apidoc/kafka.rst Normal file
View File

@@ -0,0 +1,79 @@
kafka package
=============
Subpackages
-----------
.. toctree::
kafka.consumer
kafka.partitioner
kafka.producer
Submodules
----------
kafka.client module
-------------------
.. automodule:: kafka.client
:members:
:undoc-members:
:show-inheritance:
kafka.codec module
------------------
.. automodule:: kafka.codec
:members:
:undoc-members:
:show-inheritance:
kafka.common module
-------------------
.. automodule:: kafka.common
:members:
:undoc-members:
:show-inheritance:
kafka.conn module
-----------------
.. automodule:: kafka.conn
:members:
:undoc-members:
:show-inheritance:
kafka.context module
--------------------
.. automodule:: kafka.context
:members:
:undoc-members:
:show-inheritance:
kafka.protocol module
---------------------
.. automodule:: kafka.protocol
:members:
:undoc-members:
:show-inheritance:
kafka.util module
-----------------
.. automodule:: kafka.util
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: kafka
:members:
:undoc-members:
:show-inheritance:

7
docs/apidoc/modules.rst Normal file
View File

@@ -0,0 +1,7 @@
kafka
=====
.. toctree::
:maxdepth: 4
kafka

View File

@@ -30,6 +30,7 @@ import os
# ones. # ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'sphinxcontrib.napoleon', 'sphinxcontrib.napoleon',
] ]
@@ -57,7 +58,7 @@ copyright = u'2015, David Arthur'
# The short X.Y version. # The short X.Y version.
with open('../VERSION') as version_file: with open('../VERSION') as version_file:
version = version_file.read() version = version_file.read()
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version
@@ -262,3 +263,10 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False #texinfo_no_detailmenu = False
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

View File

@@ -1,4 +1,3 @@
kafka-python kafka-python
============ ============
@@ -49,8 +48,7 @@ Contents
install install
tests tests
usage usage
api_reference API reference </apidoc/modules>
Indices and tables Indices and tables
================== ==================
@@ -58,4 +56,3 @@ Indices and tables
* :ref:`genindex` * :ref:`genindex`
* :ref:`modindex` * :ref:`modindex`
* :ref:`search` * :ref:`search`

13
tox.ini
View File

@@ -1,5 +1,6 @@
[tox] [tox]
envlist = lint, py26, py27, pypy, py33, py34 envlist = lint, py26, py27, pypy, py33, py34, docs
[testenv] [testenv]
deps = deps =
six six
@@ -37,3 +38,13 @@ deps =
mock mock
pylint pylint
commands = pylint {posargs: -E kafka test} commands = pylint {posargs: -E kafka test}
[testenv:docs]
deps =
sphinxcontrib-napoleon
sphinx_rtd_theme
sphinx
commands =
sphinx-apidoc -o docs/apidoc/ kafka/
sphinx-build -b html docs/ docs/_build