From ac4698e7a1aabfd5d3540632b5649757efbef2dd Mon Sep 17 00:00:00 2001 From: Adam Erispaha Date: Wed, 4 Dec 2024 10:40:18 -0500 Subject: [PATCH] add jupyter notebook support in docs, rotate model silliness --- docs/conf.py | 9 +++++++-- docs/index.rst | 2 +- docs/installing.md | 2 +- docs/requirements.txt | 4 ++-- docs/{usage.md => usage/index.md} | 10 ++++++++++ docs/usage/silly.md | 2 ++ 6 files changed, 23 insertions(+), 6 deletions(-) rename docs/{usage.md => usage/index.md} (98%) create mode 100644 docs/usage/silly.md diff --git a/docs/conf.py b/docs/conf.py index 423b8af..826338c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,7 +48,10 @@ 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', 'sphinx.ext.autosummary', - 'myst_parser', + # 'myst_parser', + "IPython.sphinxext.ipython_console_highlighting", + "IPython.sphinxext.ipython_directive", + "myst_nb", ] # Add any paths that contain templates here, relative to this directory. @@ -59,7 +62,9 @@ # source_suffix = { '.rst': 'restructuredtext', - '.md': 'markdown', + '.md': 'myst-nb', + ".ipynb": "myst-nb", + ".myst": "myst-nb", } # The master toctree document. diff --git a/docs/index.rst b/docs/index.rst index 7d53a5d..0dfa6a6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,7 +30,7 @@ Contents reference/index installing - usage + usage/index Indices and tables diff --git a/docs/installing.md b/docs/installing.md index e5202dc..b9f4fe2 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -1,4 +1,4 @@ -### Installation +# Installation Before installation, it's recommended to first activate a [virtualenv](https://github.com/pypa/virtualenv) to not crowd your system's package library. If you don't use any of the dependencies listed above, this step is less important. `swmmio` can be installed via pip in your command line: diff --git a/docs/requirements.txt b/docs/requirements.txt index 094e801..b7402fb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,8 +3,8 @@ pydata-sphinx-theme==0.15.2 sphinx==7.2.6 sphinx_copybutton==0.5.2 ipython==8.23.0 -myst-parser - +myst-parser==3.0.1 +myst-nb==1.1.2 # commonmark==0.9.1 diff --git a/docs/usage.md b/docs/usage/index.md similarity index 98% rename from docs/usage.md rename to docs/usage/index.md index 78eecb7..e94b89b 100644 --- a/docs/usage.md +++ b/docs/usage/index.md @@ -151,3 +151,13 @@ python -m swmmio -sp Model_Dir1 Model_Dir2 -cores_left=1

Warning

Using all cores for simultaneous model runs can put your machine's CPU usage at 100% for extended periods of time. This probably puts stress on your hardware. Use at your own risk.

+ +```{toctree} +--- +hidden: +maxdepth: 2 +--- +index.md +hello.ipynb +silly.md +``` \ No newline at end of file diff --git a/docs/usage/silly.md b/docs/usage/silly.md new file mode 100644 index 0000000..d1e9a82 --- /dev/null +++ b/docs/usage/silly.md @@ -0,0 +1,2 @@ +# Get Silly +Let's get silly with some SWMM models