diff --git a/.docs/conf.py b/.docs/conf.py index 54ea5cac4c..b0656362e7 100644 --- a/.docs/conf.py +++ b/.docs/conf.py @@ -13,16 +13,25 @@ import os import sys import shutil -from subprocess import Popen, PIPE # add flopy root directory to the python path sys.path.insert(0, os.path.abspath("..")) from flopy import __version__ -import pymake # -- determine if running on readthedocs ------------------------------------ on_rtd = os.environ.get('READTHEDOCS') == 'True' +# -- import pymake if not running on readthedocs ---------------------------- +if on_rtd: + pymake = None +else: + import pymake + +# -- create source rst files ------------------------------------------------ +cmd = "sphinx-apidoc -e -o source/ ../flopy/" +print(cmd) +os.system(cmd) + # -- get the MODFLOW executables -------------------------------------------- if not on_rtd: ws = ".bin" @@ -42,18 +51,8 @@ print(" ".join(cmd)) os.system(" ".join(cmd)) -# -- Create the flopy rst files --------------------------------------------- -args = ("sphinx-apidoc", "-e", "-o", "source/", "../flopy/") -proc = Popen(args, stdout=PIPE, stderr=PIPE, cwd=".") -stdout, stderr = proc.communicate() -if stdout: - print(stdout.decode("utf-8")) -if stderr: - print("Errors:\n{}".format(stderr.decode("utf-8"))) - - # -- Project information ----------------------------------------------------- -project = "flopy" +project = "flopy Documentation" copyright = "2020, Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N." author = "Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N." @@ -85,11 +84,6 @@ "recommonmark", ] -# nbsphinx_execute_arguments = [ -# "--InlineBackend.figure_formats={'svg', 'pdf'}", -# "--InlineBackend.rc={'figure.dpi': 200}", -# ] - # Settings for GitHub actions integration if on_rtd: extensions.append("rtds_action") diff --git a/.docs/main.rst b/.docs/main.rst index 5641f04667..522973d1ca 100644 --- a/.docs/main.rst +++ b/.docs/main.rst @@ -3,8 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to the FloPy Documentation! -=================================== +FloPy Documentation +=================== Return to the Github `FloPy `_ website where the code resides. @@ -12,7 +12,7 @@ Contents: .. toctree:: :maxdepth: 2 - + introduction Tutorial @@ -33,7 +33,7 @@ Contents: .. toctree:: :maxdepth: 2 - + code Indices and tables diff --git a/.docs/requirements.rtd.txt b/.docs/requirements.rtd.txt index b4f71fd25c..34341f54c0 100644 --- a/.docs/requirements.rtd.txt +++ b/.docs/requirements.rtd.txt @@ -4,5 +4,4 @@ ipython ipykernel rtds_action git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master -git+https://github.com/modflowpy/pymake.git@master