Skip to content

Commit b73f57b

Browse files
committed
[docs] Updated Sphinx configuration #56
Use the shared OpenWISP theme and package metadata so published documentation stays consistent with other OpenWISP projects. Adding the project root to the Sphinx path keeps local documentation builds working without an editable installation. Related to #56
1 parent 3d26724 commit b73f57b

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎docs/source/conf.py‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15+
import datetime
1516
import os
1617
import sys
1718

1819
# If extensions (or modules to document with autodoc) are in another directory,
1920
# add these directories to sys.path here. If the directory is relative to the
2021
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
# sys.path.insert(0, os.path.abspath('.'))
22+
sys.path.insert(0, os.path.abspath("../.."))
23+
24+
from netengine import VERSION, get_version
2225

2326
# -- General configuration ------------------------------------------------
2427

@@ -28,7 +31,11 @@
2831
# Add any Sphinx extension module names here, as strings. They can be
2932
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3033
# ones.
31-
extensions = []
34+
extensions = [
35+
"sphinx.ext.autodoc",
36+
"sphinx.ext.viewcode",
37+
"openwisp.sphinx.theme",
38+
]
3239

3340
# Add any paths that contain templates here, relative to this directory.
3441
templates_path = ["_templates"]
@@ -44,20 +51,21 @@
4451

4552
# General information about the project.
4653
project = "netengine"
47-
copyright = "OpenWISP.org"
54+
copyright = f"{datetime.date.today().year}, OpenWISP.org"
55+
author = "Federico Capoano"
4856

4957
# The version info for the project you're documenting, acts as replacement for
5058
# |version| and |release|, also used in various other places throughout the
5159
# built documents.
5260
#
5361
# The short X.Y version.
54-
version = "0.1"
62+
version = f"{VERSION[0]}.{VERSION[1]}"
5563
# The full version, including alpha/beta/rc tags.
56-
release = "0.1"
64+
release = get_version()
5765

5866
# The language for content autogenerated by Sphinx. Refer to documentation
5967
# for a list of supported languages.
60-
# language = None
68+
language = "en"
6169

6270
# There are two options for replacing |today|: either, you set today to some
6371
# non-false value, then it is used:
@@ -98,7 +106,7 @@
98106

99107
# The theme to use for HTML and HTML Help pages. See the documentation for
100108
# a list of builtin themes.
101-
html_theme = "default"
109+
html_theme = "openwisp-sphinx-theme"
102110

103111
# Theme options are theme-specific and customize the look and feel of a theme
104112
# further. For a list of options available for each theme, see the
@@ -198,7 +206,7 @@
198206
"index",
199207
"netengine.tex",
200208
"netengine Documentation",
201-
"Alessandro Bucciarelli, Federico Capoano",
209+
author,
202210
"manual",
203211
),
204212
]
@@ -233,7 +241,7 @@
233241
"index",
234242
"netengine",
235243
"netengine Documentation",
236-
["Alessandro Bucciarelli, Federico Capoano"],
244+
[author],
237245
1,
238246
)
239247
]
@@ -252,9 +260,9 @@
252260
"index",
253261
"netengine",
254262
"netengine Documentation",
255-
"Alessandro Bucciarelli, Federico Capoano",
263+
author,
256264
"netengine",
257-
"One line description of project.",
265+
"Abstraction layer for extracting information from network devices.",
258266
"Miscellaneous",
259267
),
260268
]

‎requirements-test.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ nose2[coverage_plugin]>=0.16.0
22
coveralls
33
jsonschema~=4.26.0
44
sphinx
5+
openwisp-sphinx-theme~=1.0.2
56
openwisp-utils[qa] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz

0 commit comments

Comments
 (0)