From b8c0f7fc2f29474383231d1a0688094cb263ac38 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:52:59 +0000 Subject: [PATCH] feat(docs): use sphinxcontrib-video for sample video Replaced the raw HTML video embed with the `sphinxcontrib-video` directive for a more robust and maintainable solution. This change involved: - Adding `sphinxcontrib-video` to the documentation requirements. - Enabling the extension in the Sphinx configuration. - Updating the `how_to_use.rst` file to use the new directive. --- docs/conf.py | 1 + docs/how_to_use.rst | 8 +++----- docs/requirements.txt | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b3ef995..9c4dded 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,6 +23,7 @@ "sphinx.ext.napoleon", "sphinxawesome_theme", "sphinx_togglebutton", + "sphinxcontrib.video", ] html_title = project templates_path = ["_templates"] diff --git a/docs/how_to_use.rst b/docs/how_to_use.rst index 5a6ac22..c622ac9 100644 --- a/docs/how_to_use.rst +++ b/docs/how_to_use.rst @@ -20,11 +20,9 @@ The main function of ``mapflow`` is ``animate``, which creates a video from an ` ds = xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib") animate(da=ds['t2m'].isel(time=slice(120)), path='animation.mp4') -.. raw:: html - - +.. video:: ../_static/animation.mp4 + :width: 640 + :height: 480 Creating a static plot ---------------------- diff --git a/docs/requirements.txt b/docs/requirements.txt index f34846c..f3687ac 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,4 +4,5 @@ sphinx-togglebutton xarray matplotlib geopandas -tqdm \ No newline at end of file +tqdm +sphinxcontrib-video \ No newline at end of file