Skip to content

Commit

Permalink
docs: drop apidoc (#602)
Browse files Browse the repository at this point in the history
* docs: drop apidoc

* format
  • Loading branch information
Borda authored Mar 20, 2021
1 parent 6bdc3f2 commit 4ec624e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 54 deletions.
42 changes: 2 additions & 40 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from importlib.util import module_from_spec, spec_from_file_location

import pt_lightning_sphinx_theme
from sphinx.ext import apidoc

_PATH_HERE = os.path.abspath(os.path.dirname(__file__))
_PATH_ROOT = os.path.join(_PATH_HERE, '..', '..')
Expand Down Expand Up @@ -146,12 +145,6 @@
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
'api/pl_bolts.rst',
'api/modules.rst',
'api/pl_bolts.submit.rst',
'api/pl_bolts.utils.*',
'api/pl_bolts.info.rst',
'api/pl_bolts.setup_tools.rst',
'PULL_REQUEST_TEMPLATE.md',
]

Expand Down Expand Up @@ -288,41 +281,11 @@
# sphinx-apidoc for me, since it's easy to forget to regen API docs
# and commit them to my repo after making changes to my code.

# packages for which sphinx-apidoc should generate the docs (.rst files)
PACKAGES = [
info.__name__,
]

apidoc_output_folder = os.path.join(_PATH_HERE, 'api')


def run_apidoc(_):
sys.path.insert(0, apidoc_output_folder)

# delete api-doc files before generating them
if os.path.exists(apidoc_output_folder):
shutil.rmtree(apidoc_output_folder)

for pkg in PACKAGES:
argv = [
'-e',
'-o',
apidoc_output_folder,
os.path.join(_PATH_ROOT, pkg),
'**/test_*',
'--force',
'--private',
'--module-first',
]

apidoc.main(argv)


def setup(app):
# this is for hiding doctest decoration,
# see: http://z4r.github.io/python/2011/12/02/hides-the-prompts-and-output/
app.add_js_file('copybutton.js')
app.connect('builder-inited', run_apidoc)


# copy all notebooks to local folder
Expand Down Expand Up @@ -365,9 +328,6 @@ def package_list_from_file(file):

autodoc_mock_imports = MOCK_PACKAGES

# for mod_name in MOCK_REQUIRE_PACKAGES:
# sys.modules[mod_name] = mock.Mock()


# Resolve function
# This function is used to populate the (source) links in the API
Expand Down Expand Up @@ -409,6 +369,8 @@ def find_source():
% (github_user, github_repo, filename)


autosummary_generate = True

autodoc_member_order = 'groupwise'
autoclass_content = 'both'
# the options are fixed and will be soon in release,
Expand Down
14 changes: 0 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. This is here to make sphinx aware of the modules but not throw an error/warning
.. toctree::
:hidden:

api/pl_bolts.callbacks
api/pl_bolts.datamodules
api/pl_bolts.datasets
api/pl_bolts.metrics
api/pl_bolts.models
api/pl_bolts.callbacks
api/pl_bolts.losses
api/pl_bolts.optimizers
api/pl_bolts.transforms

0 comments on commit 4ec624e

Please sign in to comment.