Skip to content

Commit 3e8898e

Browse files
authored
Merge pull request #21 from aboutcode-org/fix-failing-rtd-build
Fix Failing Read the Docs Build
2 parents 804843a + 887fbd4 commit 3e8898e

19 files changed

Lines changed: 47 additions & 15 deletions

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ black:
6060

6161
doc8:
6262
@echo "-> Run doc8 validation"
63-
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/build/ --quiet docs/
63+
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
6464

6565
valid: isort black doc8
6666

@@ -95,8 +95,8 @@ test:
9595
@${ACTIVATE} pytest -vvs
9696

9797
docs:
98-
rm -rf docs/build/
99-
@${ACTIVATE} sphinx-build docs/ docs/build/
98+
rm -rf docs/_build/
99+
@${ACTIVATE} sphinx-build docs/source docs/_build/
100100

101101
postgresdb:
102102
@echo "-> Configure PostgreSQL database"

docs/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = .
8+
SPHINXAUTOBUILD = sphinx-autobuild
9+
SOURCEDIR = source
910
BUILDDIR = build
1011

1112
# Put it first so that "make" without argument is like "make help".
@@ -14,7 +15,14 @@ help:
1415

1516
.PHONY: help Makefile
1617

18+
# Run the development server using sphinx-autobuild
19+
docs:
20+
@echo
21+
@echo "Starting up the docs server..."
22+
@echo
23+
$(SPHINXAUTOBUILD) --port 8000 --watch ${SOURCEDIR} $(SOURCEDIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
24+
1725
# Catch-all target: route all unknown targets to Sphinx using the new
1826
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1927
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
28+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/changelog.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/make.bat

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ REM Command file for Sphinx documentation
77
if "%SPHINXBUILD%" == "" (
88
set SPHINXBUILD=sphinx-build
99
)
10-
set SOURCEDIR=.
11-
set BUILDDIR=_build
10+
if "%SPHINXAUTOBUILD%" == "" (
11+
set SPHINXAUTOBUILD=sphinx-autobuild
12+
)
13+
set SOURCEDIR=source
14+
set BUILDDIR=build
1215

1316
if "%1" == "" goto help
1417

18+
if "%1" == "docs" goto docs
19+
1520
%SPHINXBUILD% >NUL 2>NUL
1621
if errorlevel 9009 (
1722
echo.
@@ -28,6 +33,13 @@ if errorlevel 9009 (
2833
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2934
goto end
3035

36+
:docs
37+
@echo
38+
@echo Starting up the docs server...
39+
@echo
40+
%SPHINXAUTOBUILD% --port 8000 --watch %SOURCEDIR% %SOURCEDIR% %BUILDDIR%\html %SPHINXOPTS% %O%
41+
goto end
42+
3143
:help
3244
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3345

docs/scripts/doc8_style_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# halt script on error
33
set -e
44
# Check for Style Code Violations
5-
doc8 --max-line-length 100 --ignore D000 --ignore-path build --quiet .
5+
doc8 --max-line-length 100 source --ignore D000 --quiet

docs/scripts/sphinx_build_link_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# halt script on error
33
set -e
44
# Build locally, and then check links
5-
sphinx-build -E -W -b linkcheck . build
5+
sphinx-build -E -W -b linkcheck source build
File renamed without changes.

docs/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../CHANGELOG.rst
File renamed without changes.

docs/conf.py renamed to docs/source/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@
7575

7676
master_doc = "index"
7777

78+
html_context = {
79+
"display_github": True,
80+
"github_user": "aboutcode-org",
81+
"github_repo": "federatedcode",
82+
"github_version": "main", # branch
83+
"conf_py_path": "/docs/source/", # path in the checkout to the docs root
84+
}
85+
86+
87+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
88+
html_show_sphinx = True
89+
7890
# user starts in light mode (Default Mode)
7991
default_dark_mode = False
8092

0 commit comments

Comments
 (0)