|
3 | 3 | # For the full list of built-in configuration values, see the documentation: |
4 | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
5 | 5 |
|
| 6 | +import importlib.metadata |
| 7 | +from datetime import datetime, timezone |
| 8 | + |
6 | 9 | # -- Project information ----------------------------------------------------- |
7 | 10 | # 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 | | - |
14 | 11 | project = "tika-python" |
15 | | -copyright = "2024, Chris A. Mattmann" |
16 | 12 | 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 |
17 | 17 |
|
18 | 18 | # -- 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 |
20 | 20 |
|
21 | 21 | extensions = [ |
22 | 22 | "sphinx.ext.autodoc", |
| 23 | + "sphinx.ext.apidoc", |
23 | 24 | "sphinx.ext.viewcode", |
24 | 25 | "sphinx.ext.napoleon", |
25 | 26 | "sphinx.ext.doctest", |
26 | 27 | "sphinx.ext.autosectionlabel", |
27 | | - "sphinx.ext.todo", |
28 | | - "sphinx.ext.duration", |
29 | 28 | "myst_parser", |
30 | 29 | ] |
31 | 30 |
|
32 | | -templates_path = ["_templates"] |
33 | | -exclude_patterns = ["tika.tests*"] |
| 31 | +master_doc = "index" |
| 32 | +exclude_patterns = ["_build"] |
34 | 33 |
|
| 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 | +] |
35 | 46 |
|
36 | 47 | # -- Options for HTML output ------------------------------------------------- |
37 | 48 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
38 | 49 |
|
| 50 | +REPO_URL = "https://github.com/chrismattmann/tika-python" |
| 51 | + |
39 | 52 | html_theme = "furo" |
40 | | -html_static_path = ["_static"] |
| 53 | +# html_static_path = ["_static"] |
| 54 | + |
41 | 55 | 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 |
45 | 60 | "footer_icons": [ |
46 | 61 | { |
47 | 62 | "name": "GitHub", |
48 | | - "url": "https://github.com/chrismattmann/tika-python", |
| 63 | + "url": REPO_URL, |
49 | 64 | # Embedded SVG instructions from furo docs |
50 | 65 | # Ref: https://pradyunsg.me/furo/customisation/footer/#configuration |
51 | 66 | "html": """ |
|
57 | 72 | }, |
58 | 73 | ], |
59 | 74 | } |
| 75 | +# html_copy_source = False |
| 76 | +# html_show_sourcelink = False |
0 commit comments