Skip to content

Commit 04ac13b

Browse files
authored
Clean up unused vars and fix makefile for windows (#377)
* Clean up unused vars and fix makefile for windows * Update release notes
1 parent 6bb2dc6 commit 04ac13b

File tree

9 files changed

+90
-23
lines changed

9 files changed

+90
-23
lines changed

docs/format/Makefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ SPHINXBUILD = sphinx-build
77
SPHINXAPIDOC = sphinx-apidoc
88
PAPER =
99
BUILDDIR = _build
10-
SRCDIR = ../src
1110
RSTDIR = source
12-
PKGNAME = pynwb
13-
CONFDIR = $(PWD)/source
11+
CONFDIR = $(PWD)/$(RSTDIR)
1412

1513
# Internal variables.
1614
PAPEROPT_a4 = -D latex_paper_size=a4
1715
PAPEROPT_letter = -D latex_paper_size=letter
18-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
16+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(RSTDIR)
1917
# the i18n builder cannot share the environment and doctrees with the others
2018
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2119

@@ -25,7 +23,7 @@ help:
2523
@echo "To update documentation sources from the format specification please use \`make apidoc'"
2624
@echo ""
2725
@echo "To build the documenation please use \`make <target>' where <target> is one of"
28-
@echo " fulldoc to rebuild the apidoc, html, and latexpdf all at once"
26+
@echo " fulldoc to rebuild the apidoc, html, and latexpdf documents all at once"
2927
@echo " html to make standalone HTML files"
3028
@echo " dirhtml to make HTML files named index.html in directories"
3129
@echo " singlehtml to make a single large HTML file"
@@ -45,20 +43,20 @@ help:
4543
@echo " changes to make an overview of all changed/added/deprecated items"
4644
@echo " linkcheck to check all external links for integrity"
4745
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
48-
@echo " apidoc to to build RST from source code"
46+
@echo " apidoc to build RST from source code"
4947
@echo " clean to clean all documents built by Sphinx in _build"
5048
@echo " allclean to clean all autogenerated documents both from Sphinx and apidoc"
5149

5250
allclean:
53-
-rm -rf $(BUILDDIR)/* $(RSTDIR)/$(PKGNAME)* $(RSTDIR)/modules.rst
51+
$(MAKE) clean
5452
-rm $(RSTDIR)/_format_auto_docs/*.png
5553
-rm $(RSTDIR)/_format_auto_docs/*.pdf
5654
-rm $(RSTDIR)/_format_auto_docs/*.rst
5755
-rm $(RSTDIR)/_format_auto_docs/*.inc
5856
-rm $(RSTDIR)/_format_auto_docs/git_hash.txt
5957

6058
clean:
61-
-rm -rf $(BUILDDIR)/* $(RSTDIR)/$(PKGNAME)* $(RSTDIR)/modules.rst
59+
-rm -rf $(BUILDDIR)/*
6260

6361
html:
6462
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@@ -182,4 +180,4 @@ fulldoc:
182180
@echo "Rebuilding apidoc, html, latexpdf"
183181
$(MAKE) apidoc
184182
$(MAKE) html
185-
$(MAKE) latexpdf
183+
$(MAKE) latexpdf

docs/format/make.bat

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=sphinx-build
77
)
88
set BUILDDIR=_build
9-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
9+
set RSTDIR=source
10+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %RSTDIR%
1011
set I18NSPHINXOPTS=%SPHINXOPTS% .
1112
if NOT "%PAPER%" == "" (
1213
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
@@ -18,6 +19,7 @@ if "%1" == "" goto help
1819
if "%1" == "help" (
1920
:help
2021
echo.Please use `make ^<target^>` where ^<target^> is one of
22+
echo. fulldoc to rebuild the apidoc, html, and latex documents all at once
2123
echo. html to make standalone HTML files
2224
echo. dirhtml to make HTML files named index.html in directories
2325
echo. singlehtml to make a single large HTML file
@@ -35,6 +37,19 @@ if "%1" == "help" (
3537
echo. changes to make an overview over all changed/added/deprecated items
3638
echo. linkcheck to check all external links for integrity
3739
echo. doctest to run all doctests embedded in the documentation if enabled
40+
echo. apidoc to build RST from source code
41+
echo. clean to clean all documents built by Sphinx in _build
42+
echo. allclean to clean all autogenerated documents both from Sphinx and apidoc
43+
goto end
44+
)
45+
46+
if "%1" == "allclean" (
47+
make clean
48+
del /q %RSTDIR%\_format_auto_docs\*.png
49+
del /q %RSTDIR%\_format_auto_docs\*.pdf
50+
del /q %RSTDIR%\_format_auto_docs\*.rst
51+
del /q %RSTDIR%\_format_auto_docs\*.inc
52+
del /q %RSTDIR%\_format_auto_docs\git_hash.txt
3853
goto end
3954
)
4055

@@ -187,4 +202,23 @@ results in %BUILDDIR%/doctest/output.txt.
187202
goto end
188203
)
189204

205+
if "%1" == "apidoc" (
206+
set PYTHONPATH=%cd%/source;%PYTHONPATH%
207+
nwb_generate_format_docs
208+
if errorlevel 1 exit /b 1
209+
echo.
210+
echo.Generate rst source files from NWB spec.
211+
goto end
212+
)
213+
214+
if "%1" == "fulldoc" (
215+
make allclean
216+
echo.
217+
echo.Rebuilding apidoc, html, latexpdf
218+
make apidoc
219+
make html
220+
make latex
221+
goto end
222+
)
223+
190224
:end

docs/format/source/format_release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Release Notes
3333

3434
- Add "doc" key to ImagingRetinotopy.axis_2_power_map for schema language compliance
3535

36+
- Fix makefiles for generating documentation on Windows.
37+
3638
- Add optional "reference" column in "electrodes" table
3739

3840
- Change dims of ImageSeries from (frame, y, x) to (frame, x, y) and (frame, z, y, x) to (frame, x, y, z) to be consistent with the dimension ordering in PlaneSegmentation.

docs/general/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ SPHINXBUILD = sphinx-build
77
SPHINXAPIDOC = sphinx-apidoc
88
PAPER =
99
BUILDDIR = _build
10-
SRCDIR = ../src
1110
RSTDIR = source
12-
PKGNAME = nwbstorage
1311

1412
# Internal variables.
1513
PAPEROPT_a4 = -D latex_paper_size=a4
1614
PAPEROPT_letter = -D latex_paper_size=letter
17-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
15+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(RSTDIR)
1816
# the i18n builder cannot share the environment and doctrees with the others
1917
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2018

@@ -44,6 +42,7 @@ help:
4442
@echo " changes to make an overview of all changed/added/deprecated items"
4543
@echo " linkcheck to check all external links for integrity"
4644
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
45+
@echo " clean to clean all documents built by Sphinx in _build"
4746

4847
clean:
4948
-rm -rf $(BUILDDIR)/*

docs/general/make.bat

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=sphinx-build
77
)
88
set BUILDDIR=_build
9-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
9+
set RSTDIR=source
10+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %RSTDIR%
1011
set I18NSPHINXOPTS=%SPHINXOPTS% .
1112
if NOT "%PAPER%" == "" (
1213
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
@@ -18,6 +19,7 @@ if "%1" == "" goto help
1819
if "%1" == "help" (
1920
:help
2021
echo.Please use `make ^<target^>` where ^<target^> is one of
22+
echo. fulldoc to rebuild the html and latex documents all at once
2123
echo. html to make standalone HTML files
2224
echo. dirhtml to make HTML files named index.html in directories
2325
echo. singlehtml to make a single large HTML file
@@ -35,6 +37,7 @@ if "%1" == "help" (
3537
echo. changes to make an overview over all changed/added/deprecated items
3638
echo. linkcheck to check all external links for integrity
3739
echo. doctest to run all doctests embedded in the documentation if enabled
40+
echo. clean to clean all documents built by Sphinx in _build
3841
goto end
3942
)
4043

@@ -187,4 +190,13 @@ results in %BUILDDIR%/doctest/output.txt.
187190
goto end
188191
)
189192

193+
if "%1" == "fulldoc" (
194+
make clean
195+
echo.
196+
echo.Rebuilding html, latex
197+
make html
198+
make latex
199+
goto end
200+
)
201+
190202
:end

docs/language/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ SPHINXBUILD = sphinx-build
77
SPHINXAPIDOC = sphinx-apidoc
88
PAPER =
99
BUILDDIR = _build
10-
SRCDIR = ../src
1110
RSTDIR = source
12-
PKGNAME = pynwb
1311

1412
# Internal variables.
1513
PAPEROPT_a4 = -D latex_paper_size=a4
1614
PAPEROPT_letter = -D latex_paper_size=letter
17-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
15+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(RSTDIR)
1816
# the i18n builder cannot share the environment and doctrees with the others
1917
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2018

@@ -44,9 +42,10 @@ help:
4442
@echo " changes to make an overview of all changed/added/deprecated items"
4543
@echo " linkcheck to check all external links for integrity"
4644
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
45+
@echo " clean to clean all documents built by Sphinx in _build"
4746

4847
clean:
49-
-rm -rf $(BUILDDIR)/* $(RSTDIR)/$(PKGNAME)* $(RSTDIR)/modules.rst
48+
-rm -rf $(BUILDDIR)/*
5049

5150
html:
5251
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

docs/language/make.bat

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=sphinx-build
77
)
88
set BUILDDIR=_build
9-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
9+
set RSTDIR=source
10+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %RSTDIR%
1011
set I18NSPHINXOPTS=%SPHINXOPTS% .
1112
if NOT "%PAPER%" == "" (
1213
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
@@ -18,6 +19,7 @@ if "%1" == "" goto help
1819
if "%1" == "help" (
1920
:help
2021
echo.Please use `make ^<target^>` where ^<target^> is one of
22+
echo. fulldoc to rebuild the html and latex documents all at once
2123
echo. html to make standalone HTML files
2224
echo. dirhtml to make HTML files named index.html in directories
2325
echo. singlehtml to make a single large HTML file
@@ -35,6 +37,7 @@ if "%1" == "help" (
3537
echo. changes to make an overview over all changed/added/deprecated items
3638
echo. linkcheck to check all external links for integrity
3739
echo. doctest to run all doctests embedded in the documentation if enabled
40+
echo. clean to clean all documents built by Sphinx in _build
3841
goto end
3942
)
4043

@@ -187,4 +190,13 @@ results in %BUILDDIR%/doctest/output.txt.
187190
goto end
188191
)
189192

193+
if "%1" == "fulldoc" (
194+
make clean
195+
echo.
196+
echo.Rebuilding html, latex
197+
make html
198+
make latex
199+
goto end
200+
)
201+
190202
:end

docs/storage/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ SPHINXBUILD = sphinx-build
77
SPHINXAPIDOC = sphinx-apidoc
88
PAPER =
99
BUILDDIR = _build
10-
SRCDIR = ../src
1110
RSTDIR = source
12-
PKGNAME = nwbstorage
1311

1412
# Internal variables.
1513
PAPEROPT_a4 = -D latex_paper_size=a4
1614
PAPEROPT_letter = -D latex_paper_size=letter
17-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
15+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(RSTDIR)
1816
# the i18n builder cannot share the environment and doctrees with the others
1917
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2018

@@ -44,6 +42,7 @@ help:
4442
@echo " changes to make an overview of all changed/added/deprecated items"
4543
@echo " linkcheck to check all external links for integrity"
4644
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
45+
@echo " clean to clean all documents built by Sphinx in _build"
4746

4847
clean:
4948
-rm -rf $(BUILDDIR)/*

docs/storage/make.bat

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=sphinx-build
77
)
88
set BUILDDIR=_build
9-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
9+
set RSTDIR=source
10+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %RSTDIR%
1011
set I18NSPHINXOPTS=%SPHINXOPTS% .
1112
if NOT "%PAPER%" == "" (
1213
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
@@ -18,6 +19,7 @@ if "%1" == "" goto help
1819
if "%1" == "help" (
1920
:help
2021
echo.Please use `make ^<target^>` where ^<target^> is one of
22+
echo. fulldoc to rebuild the html and latex documents all at once
2123
echo. html to make standalone HTML files
2224
echo. dirhtml to make HTML files named index.html in directories
2325
echo. singlehtml to make a single large HTML file
@@ -35,6 +37,7 @@ if "%1" == "help" (
3537
echo. changes to make an overview over all changed/added/deprecated items
3638
echo. linkcheck to check all external links for integrity
3739
echo. doctest to run all doctests embedded in the documentation if enabled
40+
echo. clean to clean all documents built by Sphinx in _build
3841
goto end
3942
)
4043

@@ -187,4 +190,13 @@ results in %BUILDDIR%/doctest/output.txt.
187190
goto end
188191
)
189192

193+
if "%1" == "fulldoc" (
194+
make clean
195+
echo.
196+
echo.Rebuilding html, latex
197+
make html
198+
make latex
199+
goto end
200+
)
201+
190202
:end

0 commit comments

Comments
 (0)