diff --git a/.gitignore b/.gitignore index 7f152569..ca1f033b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,9 @@ WecOptTool.egg-info dist/ # Sphinx -docs/_build/ docs/source/_examples docs/source/api_docs +docs/pages/ # Tutorials results results* diff --git a/docs/build_docs.py b/docs/build_docs.py index e8f4f231..7146b9fc 100644 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -87,6 +87,7 @@ def move_pages(dest_dir=None): print(f"Moving HTML pages to {os.path.join(docs_dir, 'pages', dest_dir)}...") shutil.copytree( html_dir, os.path.join(docs_dir, 'pages', dest_dir)) + shutil.rmtree(build_dir, ignore_errors=True) print('Done.') @@ -108,4 +109,3 @@ def move_pages(dest_dir=None): if name != home_name: build_doc(name, tag, home_branch, build) move_pages(dest_dir=name) - shutil.rmtree(html_dir) diff --git a/docs/clean_docs.py b/docs/clean_docs.py index f488fb7b..3912bcf6 100644 --- a/docs/clean_docs.py +++ b/docs/clean_docs.py @@ -2,16 +2,16 @@ from shutil import rmtree docs_dir = os.path.dirname(os.path.abspath(__file__)) -build_dir = os.path.join(docs_dir, '_build') source_dir = os.path.join(docs_dir, 'source') +build_dir = os.path.join(docs_dir, '_build') example_dir = os.path.join(source_dir, '_examples') api_dir = os.path.join(source_dir, 'api_docs') pages_dir = os.path.join(docs_dir, 'pages') def clean(): + rmtree(build_dir, ignore_errors=True) rmtree(example_dir, ignore_errors=True) rmtree(api_dir, ignore_errors=True) - rmtree(build_dir, ignore_errors=True) rmtree(pages_dir, ignore_errors=True) if __name__ == '__main__': diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css deleted file mode 100644 index ffc5f20e..00000000 --- a/docs/source/_static/css/custom.css +++ /dev/null @@ -1,6 +0,0 @@ -.math { - text-align: left; -} -.eqno { - float: right; -} diff --git a/docs/source/conf.py b/docs/source/conf.py index 8377ac2a..33c50b80 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -57,6 +57,7 @@ 'current_version' : current_branch, 'other_versions' : [], } + with open(os.path.join(project_root, 'docs/versions.yaml'), 'r') as v_file: versions = yaml.safe_load(v_file) for name in versions.keys(): diff --git a/docs/source/theory.rst b/docs/source/theory.rst index c8169c57..d7f60be1 100644 --- a/docs/source/theory.rst +++ b/docs/source/theory.rst @@ -54,7 +54,7 @@ How's this different from what I'm used to? Most users will be more familiar with a time-stepping approach for differential equations--this is the method applied in Simulink and therefore `WEC-Sim`_. Starting from an initial time (e.g., :math:`t=0`), the solution is solved by iteratively stepping forward in time. -.. image:: ../_build/html/_static/theory_animation_td.gif +.. image:: ../pages/_static/theory_animation_td.gif :width: 600 :alt: Time-domain solution animation :align: center @@ -62,7 +62,7 @@ Starting from an initial time (e.g., :math:`t=0`), the solution is solved by ite Pseudo-spectral methods can be applied to solve the same differential equations, but solve the entire time period of interest at once. At first the solution will not be correct, but as the optimization algorithm iterates, it will progressively improve the solution. -.. image:: ../_build/html/_static/theory_animation_ps.gif +.. image:: ../pages/_static/theory_animation_ps.gif :width: 600 :alt: Pseudo-spectral solution animation :align: center