From cd5d7d5e1ede76927d9d004494c75d05800726f2 Mon Sep 17 00:00:00 2001 From: Jamie Lemon Date: Tue, 16 Jan 2024 14:48:10 +0000 Subject: [PATCH 1/2] Integrates sphinxcontrib.apidoc to generate low-level API docs. --- doc/{ => api}/modules.rst | 4 ++-- doc/conf.py | 7 ++++++- doc/index.rst | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) rename doc/{ => api}/modules.rst (54%) diff --git a/doc/modules.rst b/doc/api/modules.rst similarity index 54% rename from doc/modules.rst rename to doc/api/modules.rst index 79e3c48d..b2debbc0 100644 --- a/doc/modules.rst +++ b/doc/api/modules.rst @@ -1,5 +1,5 @@ -API Documentation -================= +pdf2docx +======== .. toctree:: :maxdepth: 4 diff --git a/doc/conf.py b/doc/conf.py index 7219c152..1f021cb8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -40,9 +40,14 @@ def get_version(fname): # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc' + 'sphinxcontrib.apidoc' ] +apidoc_module_dir = '../pdf2docx' +apidoc_output_dir = 'api' +apidoc_excluded_paths = [] +apidoc_separate_modules = True + # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] diff --git a/doc/index.rst b/doc/index.rst index d4c47094..933388a6 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -14,7 +14,7 @@ generate docx file with ``python-docx``. installation quickstart techdoc - modules + api/modules Indices and tables From 7ca992387431666e6fa45a281fe96f4fec3ab826 Mon Sep 17 00:00:00 2001 From: Jamie Lemon Date: Tue, 16 Jan 2024 15:10:27 +0000 Subject: [PATCH 2/2] Updates doc.index.rst and requirements.rst for Read the Docs. --- doc/index.rst | 8 +++++++- doc/requirements.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/index.rst b/doc/index.rst index 933388a6..65ce18ab 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -9,11 +9,17 @@ generate docx file with ``python-docx``. .. toctree:: :maxdepth: 2 - :caption: Contents: + :caption: USER GUIDE installation quickstart techdoc + + +.. toctree:: + :maxdepth: 2 + :caption: API DOCUMENTATION + api/modules diff --git a/doc/requirements.txt b/doc/requirements.txt index cfeb3b4d..65846bd1 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ rst2pdf sphinx==5.3.0 autodoc sphinx_rtd_theme +sphinxcontrib.apidoc