Skip to content

Commit 6286248

Browse files
committed
WIP: Get sphinx-multiproject working
1 parent 2c8004c commit 6286248

File tree

7 files changed

+78
-29
lines changed

7 files changed

+78
-29
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44

55
# Required
66
version: 2
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.11"
711

812
# Build documentation in the docs/ directory with Sphinx
913
sphinx:
10-
configuration: doc/conf.py
14+
configuration: docs/conf.py
1115

1216
# If using Sphinx, optionally build your docs in additional formats such as PDF
1317
# formats:
1418
# - pdf
1519

1620
# Optionally declare the Python requirements required to build your docs
1721
python:
18-
version: 3.8
1922
install:
20-
- requirements: doc/requirements.txt
23+
- requirements: docs/requirements.txt
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
9-
BUILDDIR = _build
9+
PROJECT ?= foo
10+
BUILDDIR = _build/$(PROJECT)
1011

1112
# Put it first so that "make" without argument is like "make help".
1213
help:

docs/conf.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- General configuration ---------------------------------------------------
8+
9+
from multiproject.utils import get_project
10+
11+
# Add any Sphinx extension module names here, as strings. They can be
12+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
13+
# ones.
14+
extensions = [
15+
"multiproject",
16+
"sphinx.ext.intersphinx",
17+
"sphinx.ext.autodoc",
18+
"sphinx.ext.viewcode",
19+
"sphinx_search.extension",
20+
"myst_nb",
21+
]
22+
23+
24+
multiproject_projects = {
25+
"ops": {
26+
"path": "ops/doc/",
27+
"config": {
28+
"project": "SciJava Ops documentation",
29+
"html_title": "SciJava Ops documentation",
30+
},
31+
},
32+
}
33+
34+
docset = get_project(multiproject_projects)
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ["_templates"]
38+
39+
# List of patterns, relative to source directory, that match files and
40+
# directories to ignore when looking for source files.
41+
# This pattern also affects html_static_path and html_extra_path.
42+
exclude_patterns = [
43+
"_build",
44+
"Thumbs.db",
45+
".DS_Store",
46+
"README.md",
47+
"examples/README.md",
48+
]
49+
50+
# -- MyST-Parser/MyST-NB configuration ---------------------------------------
51+
myst_heading_anchors = 4
52+
nb_execution_mode = "off"
53+
54+
# -- Options for HTML output -------------------------------------------------
55+
56+
# The theme to use for HTML and HTML Help pages. See the documentation for
57+
# a list of builtin themes.
58+
#
59+
html_theme = "sphinx_rtd_theme"
60+
61+
# Add any paths that contain custom static files (such as style sheets) here,
62+
# relative to this directory. They are copied after the builtin static files,
63+
# so a file named "default.css" will overwrite the builtin "default.css".
64+
html_static_path = []
65+

docs/ops/doc/conf.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525

2626
# -- General configuration ---------------------------------------------------
2727

28-
# Add any Sphinx extension module names here, as strings. They can be
29-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30-
# ones.
31-
extensions = [
32-
"sphinx.ext.autodoc",
33-
"sphinx.ext.viewcode",
34-
"sphinx_search.extension",
35-
"myst_nb",
36-
]
37-
3828
# Add any paths that contain templates here, relative to this directory.
3929
templates_path = ["_templates"]
4030

@@ -54,17 +44,6 @@
5444
nb_execution_mode = "off"
5545

5646
# -- Options for HTML output -------------------------------------------------
57-
58-
# The theme to use for HTML and HTML Help pages. See the documentation for
59-
# a list of builtin themes.
60-
#
61-
html_theme = "sphinx_rtd_theme"
62-
63-
# Add any paths that contain custom static files (such as style sheets) here,
64-
# relative to this directory. They are copied after the builtin static files,
65-
# so a file named "default.css" will overwrite the builtin "default.css".
66-
html_static_path = []
67-
6847
# Add the SciJava logo
6948
# html_logo = "doc-images/logo.svg"
7049
# html_theme_options = {

docs/ops/doc/requirements.txt

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

docs/ops/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dependencies:
77
- sphinx_rtd_theme
88
- pip
99
- pip:
10+
- sphinx-multiproject
1011
- readthedocs-sphinx-search

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx-multiproject
2+
sphinx_rtd_theme
3+
myst-nb
4+
readthedocs-sphinx-search

0 commit comments

Comments
 (0)