1

I am following this tutorial on integrating sphinx with github pages and it seems like the Makefile they use is not working. When I run make github from my project's root directory, I get the following error:

config directory doesn't contain a conf.py file (C:\path\to\project_root)

However, I can run make html successfully -- only make github does not work.

Here's the Makefile I used:

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
    @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

github:
    @make html
    @cp -a build/html/. ./docs

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
    @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

And here's my folder structure:

project_root
├─ build
├─ docs
├─ source
│  └─ conf.py
└─ Makefile

EDIT: make github actually works in a git bash window. I'm on Windows so I suspect this is a platform dependent problem. Is there a way I can modify the Makefile to let it run make github successfully in windows powershell?

Atlinx
  • 318
  • 3
  • 10
  • `docs` should contain `source/`,`build/`, `conf.py`, and `Makefile` at its root, because, well it should contain all things doc-ish. – Steve Piercy Aug 23 '21 at 12:07
  • I'm using `docs` as a temporary holding space for the built docs inside of a Github actions workflow, so this should be unrelated to the problem. I ended up installing Ubuntu using the windows subsystem for Linux and using the bash command line that came with that. – Atlinx Aug 26 '21 at 13:31

1 Answers1

1

Apparently in Windows Makefile is not used at all, only make.bat.

I've wasted various hours on this as well. See Lex Li's answer here: https://stackoverflow.com/a/65471768/2040843

(Make HTML not working for Sphinx documentation in windows 10)

Yost777
  • 597
  • 1
  • 6
  • 19