11# Minimal makefile for Sphinx documentation
2+ # This make is adapted & extended from the original sphinx file
3+
4+ # #########################################################################
5+ # # Settings
26
37# You can set these variables from the command line.
48SPHINXOPTS =
@@ -7,6 +11,12 @@ SPHINXPROJ = fooof
711SOURCEDIR = .
812BUILDDIR = _build
913
14+ # Custom settings
15+ GITHUBORG = https://github.com/fooof-tools
16+
17+ # #########################################################################
18+ # # Standard sphinx tasks (from sphinx)
19+
1020# Put it first so that "make" without argument is like "make help".
1121help :
1222 @$(SPHINXBUILD ) -M help " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
1828% : Makefile
1929 @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
2030
31+ # #########################################################################
32+ # # Custom tasks
33+
2134# Custom cleaner that also removes the generated files from sphinx-gallery
2235clean :
2336 rm -rf $(BUILDDIR ) /*
@@ -35,24 +48,28 @@ check:
3548plots :
3649 python make_doc_plots.py
3750
38- # Build the html site, and push it to gh-pages branch of repo to deploy
39- install :
40- # Clean out existing build
41- make clean
51+ # Deploy the site to github pages site
52+ deploy :
4253 # Clone, specifically, the gh-pages branch, putting it into '_build/gh_pages/'
54+ # -b gh-pages --single-branch fetches specifically and only the gh-pages branch
4355 # --no-checkout just fetches the root folder without content
4456 # --depth 1 is a speed optimization since we don't need the history prior to the last commit
45- # -b gh-pages fetches only the branch for the gh-pages
46- git clone -b gh-pages --single-branch --no-checkout --depth 1 https://github.com/fooof-tools/fooof _build/gh_pages
47- # A .nojekyll file tells Github pages to bypass Jekyll processing
57+ git clone -b gh-pages --single-branch --no-checkout --depth 1 $( GITHUBORG ) / $( SPHINXPROJ ) _build/gh_pages
58+
59+ # Add a .nojekyll file to tell Github pages to bypass Jekyll processing
4860 touch _build/gh_pages/.nojekyll
49- # Build the sphinx site
50- make html
61+
5162 # Copy site into the gh-pages branch folder, then push to Github to deploy
5263 cd _build/ && \
5364 cp -r html/* gh_pages && \
5465 cd gh_pages && \
5566 git add * && \
5667 git add .nojekyll && \
57- git commit -a -m ' Make install ' && \
68+ git commit -a -m 'deploy docsite ' && \
5869 git push
70+
71+ # Clean & rebuild the html site, then deploy docsite
72+ install :
73+ make clean
74+ make html
75+ make deploy
0 commit comments