Skip to content

Commit

Permalink
[INFRA] Patch make files for doc build (#67)
Browse files Browse the repository at this point in the history
* First pass at doc builder GHA

* Scrub nilearn-specific infra

* Update Make infra
  • Loading branch information
emdupre committed Aug 29, 2023
1 parent 6511d79 commit 80cc0be
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Workflow to build the documentation.
name: Build docs
name: Build documentation
on:
push:
branches:
Expand Down
32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

65 changes: 65 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Makefile for Sphinx documentation
#

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

# Internal variables
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .

.PHONY: help html dirhtml htmlhelp

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " htmlhelp to make HTML files and a HTML help project"


force_html: force html

force:
find . -name \*.rst -exec touch {} \;

html:
# These two lines make the build a bit more lengthy, and the
# the embedding of images more robust
rm -rf $(BUILDDIR)/html/_images
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
touch $(BUILDDIR)/html/.nojekyll
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

html-strict:
# Build html documentation using a strict mode: Warnings are
# considered as errors.
make check
touch $(BUILDDIR)/html/.nojekyll
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
touch $(BUILDDIR)/dirhtml .nojekyll
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

install:
git clone --no-checkout --depth 1 https://github.com/Parietal-INRIA/fmralign.github.io.git build/fmralign.github.io
touch build/fmralign.github.io/.nojekyll
make html
cd build/ && \
cp -r html/* fmralign.github.io && \
cd fmralign.github.io && \
git add * && \
git add .nojekyll && \
git commit -a -m 'Make install' && \
git push
58 changes: 58 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@ECHO OFF

pushd %~dp0
REM Command file for Sphinx documentation

set SPHINXBUILD=sphinx-build
set SOURCEDIR=source
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .

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
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. htmlhelp to make HTML files and a HTML help project
goto end
)

if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)

if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)

if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)

:end
popd
35 changes: 0 additions & 35 deletions make.bat

This file was deleted.

0 comments on commit 80cc0be

Please sign in to comment.