Skip to content

Commit

Permalink
adding api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed May 4, 2019
1 parent 11febcb commit 1464ae4
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 10 deletions.
29 changes: 29 additions & 0 deletions docs/api.rst
@@ -0,0 +1,29 @@
API
====

.. toctree::
:maxdepth: 4

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

.. toctree::

tdameritrade.auth

.. automodule:: tdameritrade.client
:members:
:undoc-members:
:show-inheritance:

.. automodule:: tdameritrade.urls
:members:
:undoc-members:
:show-inheritance:

.. automodule:: tdameritrade.auth
:members:
:undoc-members:
:show-inheritance:
31 changes: 26 additions & 5 deletions docs/conf.py
Expand Up @@ -17,10 +17,12 @@
# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sys
import os
import os.path
import subprocess
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))


# -- General configuration ------------------------------------------------
Expand All @@ -32,8 +34,7 @@
# 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.coverage',
'sphinx.ext.viewcode']
extensions = ['sphinx.ext.coverage', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -168,3 +169,23 @@
author, 'tdameritrade', 'One line description of project.',
'Miscellaneous'),
]


def run_apidoc(_):
out_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'api'))
mod_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'tdameritrade'))
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
subprocess.check_call([cmd_path,
'-E',
'-M',
'-o',
out_dir,
mod_dir,
'--force'])


def setup(app):
app.connect('builder-inited', run_apidoc)
31 changes: 26 additions & 5 deletions docs/conf.py.in
Expand Up @@ -17,10 +17,12 @@
# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sys
import os
import os.path
import subprocess
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))


# -- General configuration ------------------------------------------------
Expand All @@ -32,8 +34,7 @@ import sphinx_rtd_theme
# 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.coverage',
'sphinx.ext.viewcode']
extensions = ['sphinx.ext.coverage', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -168,3 +169,23 @@ texinfo_documents = [
author, 'tdameritrade', 'One line description of project.',
'Miscellaneous'),
]


def run_apidoc(_):
out_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'api'))
mod_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'tdameritrade'))
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
subprocess.check_call([cmd_path,
'-E',
'-M',
'-o',
out_dir,
mod_dir,
'--force'])


def setup(app):
app.connect('builder-inited', run_apidoc)
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -18,6 +18,7 @@ Python interface to TD Ameritrade Api
installation
authentication
quickstart
api


.. |build-status| image:: https://travis-ci.org/timkpaine/tdameritrade.svg?branch=master
Expand Down

0 comments on commit 1464ae4

Please sign in to comment.