diff --git a/docs/conf.py b/docs/conf.py index cd2827596..efb73cf4b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,15 +38,16 @@ "_extension.gallery_directive", "_extension.component_directive", # For extension examples and demos - "myst_parser", + # "myst_parser", "ablog", "jupyter_sphinx", "sphinxcontrib.youtube", - "nbsphinx", + # "nbsphinx", "numpydoc", "sphinx_togglebutton", "jupyterlite_sphinx", "sphinx_favicon", + "myst_nb", ] jupyterlite_config = "jupyterlite_config.json" diff --git a/docs/examples/pydata.ipynb b/docs/examples/pydata.ipynb index 7f2d7d189..c63a73321 100644 --- a/docs/examples/pydata.ipynb +++ b/docs/examples/pydata.ipynb @@ -8,8 +8,13 @@ "\n", "This theme has built-in support and special styling for several major visualization libraries in the PyData ecosystem.\n", "This ensures that the images and output generated by these libraries looks good for both light and dark modes.\n", - "Below are examples of each that we use as a benchmark for reference.\n", - "\n", + "Below are examples of each that we use as a benchmark for reference." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "## Pandas" ] }, @@ -30,6 +35,46 @@ "df" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## IPyWidget" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "import ipywidgets as widgets\n", + "from IPython.display import display\n", + "\n", + "tab = widgets.Tab()\n", + "\n", + "descr_str = \"Hello\"\n", + "\n", + "title = widgets.HTML(descr_str)\n", + "\n", + "# create output widgets\n", + "widget_images = widgets.Output()\n", + "widget_annotations = widgets.Output()\n", + "\n", + "# render in output widgets\n", + "with widget_images:\n", + " display(pd.DataFrame(np.random.randn(10,10)))\n", + "with widget_annotations:\n", + " display(pd.DataFrame(np.random.randn(10,10)))\n", + "\n", + "tab.children = [widget_images, widget_annotations]\n", + "tab.titles = [\"Images\", \"Annotations\"]\n", + "\n", + "display(widgets.VBox([title, tab]))" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -143,7 +188,7 @@ }, "language_info": { "name": "python", - "version": "3.10.8" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/pyproject.toml b/pyproject.toml index 8d674125d..b123b07ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,8 @@ doc = [ "nbsphinx", "ipyleaflet", "colorama", + "ipywidgets", + "myst-nb" ] test = ["pytest", "pytest-cov", "pytest-regressions"] dev = ["pyyaml", "pre-commit", "nox", "pydata-sphinx-theme[doc,test]"]