I want to keep all my sphinx files in their own directory documentation/
, so that my project looks like this:
.
├─ documentation
│ ├─ _static/
│ ├─ _templates/
│ ├─ build/
│ ├─ index.rst
│ ├─ Makefile
│ ╰─ conf.py
╰─ source
╰─ main.py
In documentation/Makefile
I have set the source directory:
SOURCEDIR = ../source
In documentation/conf.py
I've added the source path:
import os
import sys
sys.path.insert(0, os.path.abspath('../source'))
I haven't changed the default values in index.rst
.
My output when I build:
$ cd documentation
$ sphinx-build . build/
Running Sphinx v4.1.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.
The HTML pages are in build.
It generates documentation/build/index.html
as you would expect, but it hasn't actually done the auto-documentation. There's nothing there:
My guesses are:
- I need to specify which files to document in
index.rst
- I haven't pointed Sphinx to my source directory correctly