Skip to content

Commit

Permalink
Copy static x3d files before running sphinx-build
Browse files Browse the repository at this point in the history
This commit resolves an issue where Sphinx will not copy static X3D files from the source to the build directory before loading extensions, which results in a FileNotFoundError and causes the build process to exit. It is documented in Sphinx issues #2090 and #1810 that this is expected behavior.
  • Loading branch information
josephburkhart committed Feb 7, 2025
1 parent 7262ab2 commit 28da9e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
STATICDIR = _static

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -16,5 +17,12 @@ help:

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# Note:
# Second line ensures that there is a build x3d folder
# Third line copies the X3D files from _static (Sphinx doesn't copy them correctly)
# Fourth line runs the sphinx build command
%: Makefile
@echo "Creating ./$(BUILDDIR)/$@/$(STATICDIR)/x3d...";
@mkdir -p "$(BUILDDIR)/$@/$(STATICDIR)/x3d"
@cp -r "./$(SOURCEDIR)/$(STATICDIR)/x3d" "./$(BUILDDIR)/$@/$(STATICDIR)"
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 comments on commit 28da9e3

Please sign in to comment.