Skip to content

Commit 38f5011

Browse files
authored
Merge pull request #74 from stephanlachnit/p/docs
doc: add proper documentation
2 parents 5f4febb + 22a8554 commit 38f5011

File tree

10 files changed

+54
-501
lines changed

10 files changed

+54
-501
lines changed

.github/workflows/docs-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Check Sphinx Documentation build minimally
3030
working-directory: ./docs
31-
run: sphinx-build -E -W source build
31+
run: python3 -m sphinx -E -W source build
3232

3333
- name: Check for documentation style errors
3434
working-directory: ./docs
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
license\_expression package
2+
===========================
3+
4+
Module contents
5+
---------------
6+
7+
.. automodule:: license_expression
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/source/api/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
license_expression
2+
==================
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
license_expression

docs/source/conf.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
# -- Path setup --------------------------------------------------------------
88

99
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
# import os
14-
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
10+
# add these directories to sys.path here.
11+
12+
import pathlib
13+
import sys
1614

15+
srcdir = pathlib.Path(__file__).resolve().parents[2].joinpath('src')
16+
sys.path.insert(0, srcdir.as_posix())
1717

1818
# -- Project information -----------------------------------------------------
1919

@@ -28,19 +28,25 @@
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
3030
extensions = [
31+
"sphinx.ext.autodoc",
3132
"sphinx.ext.intersphinx",
33+
"sphinxcontrib.apidoc",
3234
]
3335

34-
# This points to aboutcode.readthedocs.io
35-
# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot
36-
# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83
36+
# FIXME: including AND, NOT and OR will result in endless recursion
37+
autodoc_default_options = {
38+
'exclude-members': 'AND, NOT, OR',
39+
}
3740

41+
# Setting for sphinxcontrib.apidoc to automatically create API documentation.
42+
apidoc_module_dir = srcdir.joinpath('license_expression').as_posix()
43+
44+
# Reference to other Sphinx documentations
3845
intersphinx_mapping = {
39-
"aboutcode": ("https://aboutcode.readthedocs.io/en/latest/", None),
40-
"scancode-workbench": ("https://scancode-workbench.readthedocs.io/en/develop/", None),
46+
"python": ("https://docs.python.org/3", None),
47+
"boolean.py": ("https://booleanpy.readthedocs.io/en/latest/", None),
4148
}
4249

43-
4450
# Add any paths that contain templates here, relative to this directory.
4551
templates_path = ["_templates"]
4652

docs/source/contribute/contrib_doc.rst

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

0 commit comments

Comments
 (0)