Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 4ec624e

Browse files
authored
docs: drop apidoc (#602)
* docs: drop apidoc * format
1 parent 6bdc3f2 commit 4ec624e

File tree

2 files changed

+2
-54
lines changed

2 files changed

+2
-54
lines changed

docs/source/conf.py

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from importlib.util import module_from_spec, spec_from_file_location
2222

2323
import pt_lightning_sphinx_theme
24-
from sphinx.ext import apidoc
2524

2625
_PATH_HERE = os.path.abspath(os.path.dirname(__file__))
2726
_PATH_ROOT = os.path.join(_PATH_HERE, '..', '..')
@@ -146,12 +145,6 @@
146145
# directories to ignore when looking for source files.
147146
# This pattern also affects html_static_path and html_extra_path.
148147
exclude_patterns = [
149-
'api/pl_bolts.rst',
150-
'api/modules.rst',
151-
'api/pl_bolts.submit.rst',
152-
'api/pl_bolts.utils.*',
153-
'api/pl_bolts.info.rst',
154-
'api/pl_bolts.setup_tools.rst',
155148
'PULL_REQUEST_TEMPLATE.md',
156149
]
157150

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

291-
# packages for which sphinx-apidoc should generate the docs (.rst files)
292-
PACKAGES = [
293-
info.__name__,
294-
]
295-
296-
apidoc_output_folder = os.path.join(_PATH_HERE, 'api')
297-
298-
299-
def run_apidoc(_):
300-
sys.path.insert(0, apidoc_output_folder)
301-
302-
# delete api-doc files before generating them
303-
if os.path.exists(apidoc_output_folder):
304-
shutil.rmtree(apidoc_output_folder)
305-
306-
for pkg in PACKAGES:
307-
argv = [
308-
'-e',
309-
'-o',
310-
apidoc_output_folder,
311-
os.path.join(_PATH_ROOT, pkg),
312-
'**/test_*',
313-
'--force',
314-
'--private',
315-
'--module-first',
316-
]
317-
318-
apidoc.main(argv)
319-
320284

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

327290

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

366329
autodoc_mock_imports = MOCK_PACKAGES
367330

368-
# for mod_name in MOCK_REQUIRE_PACKAGES:
369-
# sys.modules[mod_name] = mock.Mock()
370-
371331

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

411371

372+
autosummary_generate = True
373+
412374
autodoc_member_order = 'groupwise'
413375
autoclass_content = 'both'
414376
# the options are fixed and will be soon in release,

docs/source/index.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,3 @@ Indices and tables
113113
* :ref:`genindex`
114114
* :ref:`modindex`
115115
* :ref:`search`
116-
117-
.. This is here to make sphinx aware of the modules but not throw an error/warning
118-
.. toctree::
119-
:hidden:
120-
121-
api/pl_bolts.callbacks
122-
api/pl_bolts.datamodules
123-
api/pl_bolts.datasets
124-
api/pl_bolts.metrics
125-
api/pl_bolts.models
126-
api/pl_bolts.callbacks
127-
api/pl_bolts.losses
128-
api/pl_bolts.optimizers
129-
api/pl_bolts.transforms

0 commit comments

Comments
 (0)