Skip to content

Commit ed80a87

Browse files
committed
restructure docs
1 parent 8bb0ca8 commit ed80a87

6 files changed

Lines changed: 44 additions & 119 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ setup.cfg
2323

2424
# Sphinx documentation
2525
docs/build/
26+
# auto-generated by sphinx-apidoc
27+
docs/source/api/

docs/source/conf.py

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,64 @@
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

6+
import importlib.metadata
7+
from datetime import datetime, timezone
8+
69
# -- Project information -----------------------------------------------------
710
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8-
import os
9-
import sys
10-
11-
# Add the parent directory of the documentation root to sys.path
12-
sys.path.insert(0, os.path.abspath("../.."))
13-
1411
project = "tika-python"
15-
copyright = "2024, Chris A. Mattmann"
1612
author = "Chris A. Mattmann"
13+
current_year = datetime.now(timezone.utc).astimezone().year
14+
copyright = f"{current_year}, {author}"
15+
version = importlib.metadata.version("tika")
16+
release = version
1717

1818
# -- General configuration ---------------------------------------------------
19-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
19+
# Ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2020

2121
extensions = [
2222
"sphinx.ext.autodoc",
23+
"sphinx.ext.apidoc",
2324
"sphinx.ext.viewcode",
2425
"sphinx.ext.napoleon",
2526
"sphinx.ext.doctest",
2627
"sphinx.ext.autosectionlabel",
27-
"sphinx.ext.todo",
28-
"sphinx.ext.duration",
2928
"myst_parser",
3029
]
3130

32-
templates_path = ["_templates"]
33-
exclude_patterns = ["tika.tests*"]
31+
master_doc = "index"
32+
exclude_patterns = ["_build"]
3433

34+
nitpicky = True
35+
36+
# -- sphinx-apidoc configuration ---------------------------------------------------
37+
# Ref: https://www.sphinx-doc.org/en/master/usage/extensions/apidoc.html#confval-apidoc_modules
38+
apidoc_modules = [
39+
{
40+
"path": "../../tika",
41+
"destination": "api",
42+
"separate_modules": True,
43+
"module_first": True,
44+
},
45+
]
3546

3647
# -- Options for HTML output -------------------------------------------------
3748
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3849

50+
REPO_URL = "https://github.com/chrismattmann/tika-python"
51+
3952
html_theme = "furo"
40-
html_static_path = ["_static"]
53+
# html_static_path = ["_static"]
54+
4155
html_theme_options = {
42-
"source_repository": "https://github.com/chrismattmann/tika-python",
43-
"source_branch": "master",
44-
"source_directory": "docs/source/",
56+
"source_repository": REPO_URL,
57+
# "source_branch": "master",
58+
# "source_directory": "docs/source/",
59+
"top_of_page_buttons": [], # Note: do not show edit and view buttons
4560
"footer_icons": [
4661
{
4762
"name": "GitHub",
48-
"url": "https://github.com/chrismattmann/tika-python",
63+
"url": REPO_URL,
4964
# Embedded SVG instructions from furo docs
5065
# Ref: https://pradyunsg.me/furo/customisation/footer/#configuration
5166
"html": """
@@ -57,3 +72,5 @@
5772
},
5873
],
5974
}
75+
# html_copy_source = False
76+
# html_show_sourcelink = False

docs/source/index.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
.. tika-python documentation master file, created by
2-
sphinx-quickstart on Sun Apr 14 20:07:31 2024.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
1+
.. include:: ../../README.md
2+
:parser: myst_parser.sphinx_
53

6-
Welcome to tika-python's documentation!
7-
=======================================
4+
Contents
5+
--------
86

97
.. toctree::
10-
:maxdepth: 7
11-
:caption: Contents:
8+
:maxdepth: 1
9+
10+
API <api/modules>
1211

13-
readme
14-
tika
1512

1613
Indices and tables
17-
==================
14+
------------------
1815

1916
* :ref:`genindex`
2017
* :ref:`modindex`
21-
* :ref:`search`

docs/source/modules.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/source/readme.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/source/tika.rst

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)