From 7848678a851f1c96cbff5dad7e4e067408bc25a6 Mon Sep 17 00:00:00 2001
From: Simon Billinge <simon.billinge@gmail.com>
Date: Sat, 20 Jul 2024 12:13:18 -0400
Subject: [PATCH] debugging publish tweaks

---
 doc/source/Makefile |  2 +-
 doc/source/conf.py  |  4 ++--
 doc/source/make.bat | 25 ++++++++++++++++++++++++-
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/doc/source/Makefile b/doc/source/Makefile
index 9edc8b10d..0b3c0b0db 100644
--- a/doc/source/Makefile
+++ b/doc/source/Makefile
@@ -5,7 +5,7 @@
 SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
 PAPER         =
-BUILDDIR      = _build
+BUILDDIR      = build
 BASENAME      = $(subst .,,$(subst $() $(),,regolith))
 RELEASE = v0.1
 
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 8d3fc0aff..70bf3ad17 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -185,7 +185,7 @@
 html_domain_indices = False
 
 # If false, no index is generated.
-html_use_index = False
+html_use_index = True
 
 # If true, the index is split into individual pages for each letter.
 html_split_index = False
@@ -194,7 +194,7 @@
 html_show_sourcelink = False
 
 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-html_show_sphinx = False
+html_show_sphinx = True
 
 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
 # html_show_copyright = True
diff --git a/doc/source/make.bat b/doc/source/make.bat
index ec0e4c3f9..0cb271624 100644
--- a/doc/source/make.bat
+++ b/doc/source/make.bat
@@ -1,11 +1,14 @@
 @ECHO OFF
 
+pushd %~dp0
+
 REM Command file for Sphinx documentation
 
 if "%SPHINXBUILD%" == "" (
 	set SPHINXBUILD=sphinx-build
 )
-set BUILDDIR=_build
+set SOURCEDIR=source
+set BUILDDIR=build
 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
 set I18NSPHINXOPTS=%SPHINXOPTS% .
 if NOT "%PAPER%" == "" (
@@ -15,6 +18,19 @@ if NOT "%PAPER%" == "" (
 
 if "%1" == "" goto help
 
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+	echo.
+	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+	echo.installed, then set the SPHINXBUILD environment variable to point
+	echo.to the full path of the 'sphinx-build' executable. Alternatively you
+	echo.may add the Sphinx directory to PATH.
+	echo.
+	echo.If you don't have Sphinx installed, grab it from
+	echo.http://sphinx-doc.org/
+	exit /b 1
+)
+
 if "%1" == "help" (
 	:help
 	echo.Please use `make ^<target^>` where ^<target^> is one of
@@ -187,4 +203,11 @@ results in %BUILDDIR%/doctest/output.txt.
 	goto end
 )
 
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
+
 :end
+popd