Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconfigured tutorial videos for RTFD #2458

Merged
merged 4 commits into from
Aug 15, 2024
Merged

Reconfigured tutorial videos for RTFD #2458

merged 4 commits into from
Aug 15, 2024

Conversation

ReimarBauer
Copy link
Member

Purpose of PR?:

Fixes #2454

There are some ongoing changes on RTFD, https://about.readthedocs.com/blog/2024/07/addons-by-default/
I had not thought that this will make a difference for us.
But the UI is much more comfortable now. It was simple to add this branch hidden to the config.
https://mss.readthedocs.io/en/i2454/tutorial.html

Currently locally a sphinx build does differently for the used videos. I added a workaround for this.
Important is that we can render videos on RTFD.

docs/conf.py Outdated
if not os.path.exists("../docs/_build"):
logging.debug("Build directory not found.")
return
TUTORIAL_DIR = '../docs/_build/html/videos/mp4'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this interact with building the docs for a target different from html?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the issue yet, but treating RTD and non-RTD differently and directly writing to the _build directory here seems wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so true, I spend yesterday a lot time trying, to get only to this workaround.

Ha, and now I have a new idea what got wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, no, no typo in the extensions definition. It just makes only things now different on RTFD and local.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #2458 (comment). The underlying issue is a version mismatch of sphincontrib-video between conda-forge (local) and PyPI (RTD).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sphinx on RTFD collects the media and copies all to a static _images and changes then the urls in the HTML

.. image:: /mss_theme/img/wise12_overview.png
->
https://mss.readthedocs.io/en/i2454/_images/wise12_overview.png

.. video:: ./videos/mp4/tutorial_waypoints.mp4
->
https://mss.readthedocs.io/en/i2454/_images/tutorial_waypoints.mp4

locally it does, with that PR

  • file:///home/reimar/MAIN/MSS/docs/_build/html/_images/wise12_overview.png
  • file:///home/reimar/MAIN/MSS/docs/_build/html/videos/mp4/tutorial_waypoints.mp4

and locally it is also not wider than the text

image

Copy link
Collaborator

@matrss matrss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2024-08-14 13-16-05

The videos are way to wide. I think they shouldn't be wider than the text column is.

@ReimarBauer
Copy link
Member Author

Screenshot from 2024-08-14 13-16-05

The videos are way to wide. I think they shouldn't be wider than the text column is.

yes, that can be done in a new issue or with resized videos, where the content can't be readed. That was the problem with smaller videos in the past.

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

There are some ongoing changes on RTFD, https://about.readthedocs.com/blog/2024/07/addons-by-default/

From what is written there these changes shouldn't affect us yet. Did we manually opt-in already?

@ReimarBauer
Copy link
Member Author

it might also be a change in sphinx, they use 8.0.2 which we currently can't with their theme. But a pinning did also not help to get the old state.

https://sphinxcontrib-video.readthedocs.io/en/latest/quickstart.html#video-directive

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

I actually suspect that this issue is caused by this new feature: sphinx-contrib/video#36

It is part of sphinxcontrib-video=0.2.1, but not of sphinxcontrib-video=0.2.0. The latter is the latest version on conda-forge, while the former is available on PyPI. The readthedocs environment installs it from PyPI, while you probably have the older version from conda-forge.

With this new feature the video source references should point to the video files in docs/videos/mp4 and will then be copied over into _build automatically. So the only necessary changes to fix the videos are these:

diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index a188127e..8fe213c4 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -9,7 +9,7 @@ a `public share <https://fz-juelich.sciebo.de/s/IzNGi24Ki68iV7t#pdfviewer>`_
 Get familiar by some videos about the Mission Support System (MSS).
 
 
-  .. video:: _static/mp4/tutorial_waypoints.mp4
+  .. video:: videos/mp4/tutorial_waypoints.mp4
      :autoplay:
      :loop:
      :alt: This is the waypoints tutorial,i.e., whenever we are going to plan
diff --git a/docs/tutorials/tutorial_hexagoncontrol.rst b/docs/tutorials/tutorial_hexagoncontrol.rst
index 0c3dae42..a212a70e 100644
--- a/docs/tutorials/tutorial_hexagoncontrol.rst
+++ b/docs/tutorials/tutorial_hexagoncontrol.rst
@@ -3,7 +3,7 @@ Table View and Hexagon Flight Patterns
 
 For tomographic imaging, a hexagonal flight pattern can be integrated by a docking widget of Table View
 
-   .. video:: ../_static/mp4/tutorial_hexagoncontrol.mp4
+   .. video:: ../videos/mp4/tutorial_hexagoncontrol.mp4
      :alt: Top View windows is opened (CTRL+H).
            We select the "global (cyl)" for the world map.
            Zooming in for the required region.
diff --git a/docs/tutorials/tutorial_introduction_topview.rst b/docs/tutorials/tutorial_introduction_topview.rst
index b4edd8a1..b72815f0 100644
--- a/docs/tutorials/tutorial_introduction_topview.rst
+++ b/docs/tutorials/tutorial_introduction_topview.rst
@@ -3,7 +3,7 @@ Top View and Selecting of Layers
 
 Selection and display of different data in the Top View with the help of the layer chooser.
 
-  .. video:: ../_static/mp4/tutorial_wms.mp4
+  .. video:: ../videos/mp4/tutorial_wms.mp4
      :alt: When we open the Top View (CTRL+H) of the map, the Web Map Service is already opened by default.
            It collects its data from the server: "open-mss dot org" that provides demodata for the meteorological or
            atmospheric information as layer lists.
diff --git a/docs/tutorials/tutorial_kml.rst b/docs/tutorials/tutorial_kml.rst
index 5d8c3d95..68a85903 100644
--- a/docs/tutorials/tutorial_kml.rst
+++ b/docs/tutorials/tutorial_kml.rst
@@ -3,7 +3,7 @@ Top View and KML Data
 
 es can be displayed in the Top View. Color and line width can be adjusted.
 
-  .. video:: ../_static/mp4/tutorial_kml.mp4
+  .. video:: ../videos/mp4/tutorial_kml.mp4
      :alt: Open the TopView (CTRL+H)
            After clicking on "(select to open control)", click on KML OVERLAY. The UI will look as shown.
            KML files can be used to show the geographical boundary which helps in planning the WAY POINTS.
@@ -23,4 +23,4 @@ es can be displayed in the Top View. Color and line width can be adjusted.
            Changing it for some time...
            Now, we change line width by changing its numerical value whose range is 0 to 10.
            We change it to different values to obtain different linewidths.
-           The top view is closed and the tutorial ends.
\ No newline at end of file
+           The top view is closed and the tutorial ends.
diff --git a/docs/tutorials/tutorial_mscolab.rst b/docs/tutorials/tutorial_mscolab.rst
index c4164fa9..7d9cb4a9 100644
--- a/docs/tutorials/tutorial_mscolab.rst
+++ b/docs/tutorials/tutorial_mscolab.rst
@@ -5,7 +5,7 @@ Using the different views of the MSUI with a fictitious flight path and demo dat
 In comparison to the standalone mode of the MSUI an example setup of users is
 shown on a MSColab server and the possibilities of interactions.
 
-  .. video:: ../_static/mp4/tutorial_mscolab.mp4
+  .. video:: ../videos/mp4/tutorial_mscolab.mp4
      :alt: MSColab stores data in an online server, and can be used to access the data remotely as also working in a
            team where everyone contributes his part. It is used for collaborating with the users as a team together
            and working on a shared MSColab operation.
diff --git a/docs/tutorials/tutorial_msui_views.rst b/docs/tutorials/tutorial_msui_views.rst
index 7e1ba7dc..27910e9a 100644
--- a/docs/tutorials/tutorial_msui_views.rst
+++ b/docs/tutorials/tutorial_msui_views.rst
@@ -4,7 +4,7 @@ Introduction to MSUI
 Using the different views of the MSUI with a fictitious flight path and demo data.
 
 
-  .. video:: ../_static/mp4//tutorial_views.mp4
+  .. video:: ../videos/mp4/tutorial_views.mp4
      :alt: Lets look at the tutorial of the various views required for flight planning:
            Top View (CTRL+H), Side View (CTRL+V), Linear View (CTRL+L) and Table View (CTRL+T).
            At first, lets open Top View and Side View.
diff --git a/docs/tutorials/tutorial_performance_settings.rst b/docs/tutorials/tutorial_performance_settings.rst
index 82954355..59820e2c 100644
--- a/docs/tutorials/tutorial_performance_settings.rst
+++ b/docs/tutorials/tutorial_performance_settings.rst
@@ -3,7 +3,7 @@ Table View and Aircraft Performance Data
 
 The range-specific data of an aircraft can be taken into account in Tableview for flight planning.
 
-  .. video:: ../_static/mp4/tutorial_performancesettings.mp4
+  .. video:: ../videos/mp4/tutorial_performancesettings.mp4
      :alt: This is the Performance Settings dockwidget opened in the Table View (CTRL+T) of the MSS software
            where by putting and changing some parameters, we can evaluate the performance of the aircraft.
            Parameters like Flight Altitude, Aviation fuel, Aircraft weight, Maximum take off weight
diff --git a/docs/tutorials/tutorial_remotesensing.rst b/docs/tutorials/tutorial_remotesensing.rst
index e1a1d125..65d1dbf4 100644
--- a/docs/tutorials/tutorial_remotesensing.rst
+++ b/docs/tutorials/tutorial_remotesensing.rst
@@ -4,7 +4,7 @@ Top View and Remotesensing Tools
 In order to be able to take into account the viewing angle and solar level for measuring instruments, the remotesensing tools are used
 
 
-  .. video:: ../_static/mp4/tutorial_remotesensing.mp4
+  .. video:: ../videos/mp4/tutorial_remotesensing.mp4
      :alt: This is the Remote Sensing Section of the Top View.
            It shows the position and angle of the flight from any particular object in the sky.
            Azimuth is the forward direction line of the flight. If we go above tHE AZIMUTH, angle is in positive,
diff --git a/docs/tutorials/tutorial_satellitetrack.rst b/docs/tutorials/tutorial_satellitetrack.rst
index 04561d81..7c6b5555 100644
--- a/docs/tutorials/tutorial_satellitetrack.rst
+++ b/docs/tutorials/tutorial_satellitetrack.rst
@@ -4,7 +4,7 @@ Top View and  Satellite Overflight
 To combine a flight path with a satellite overflight, the remotesensing widget is used.
 
 
-  .. video:: ../_static/mp4/tutorial_satellitetrack.mp4
+  .. video:: ../videos/mp4/tutorial_satellitetrack.mp4
      :alt: This is Satellite Tracking Prediction System that can be used to check the accuracy of the path
            travelled by a Satellite by the help of data collected from different space agencies and planning
            a flight accordingly.
diff --git a/docs/tutorials/tutorial_waypoints.rst b/docs/tutorials/tutorial_waypoints.rst
index e43d21f3..87938a01 100644
--- a/docs/tutorials/tutorial_waypoints.rst
+++ b/docs/tutorials/tutorial_waypoints.rst
@@ -3,7 +3,7 @@ Top View Drawing Waypoints
 
 Waypoints for a flight path are defined, shifted and deleted.
 
-  .. video:: ../_static/mp4/tutorial_waypoints.mp4
+  .. video:: ../videos/mp4/tutorial_waypoints.mp4
      :alt: This is the waypoints tutorial,i.e., whenever we are going to plan
            a flight track, we have to place the waypoints in some places and,
            form a flight path.

... and using sphinxcontrib-video>=0.2.1.

@ReimarBauer
Copy link
Member Author

ReimarBauer commented Aug 14, 2024

Because there is only a rc0 on pypi there is no automated conda package with a newer version
but we can use on rtfd the pypi rc0.

https://github.com/conda-forge/sphinxcontrib-video-feedstock/blob/main/recipe/meta.yaml

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

Because there is only a rc0 on pypi

This isn't right, there is 0.2.1rc0 and 0.2.1 on PyPI. It should become available on conda-forge once you merge this: conda-forge/sphinxcontrib-video-feedstock#1

@ReimarBauer ReimarBauer reopened this Aug 14, 2024
@ReimarBauer
Copy link
Member Author

Because there is only a rc0 on pypi

This isn't right, there is 0.2.1rc0 and 0.2.1 on PyPI. It should become available on conda-forge once you merge this: conda-forge/sphinxcontrib-video-feedstock#1

oh yeah,

now its on its path

@ReimarBauer
Copy link
Member Author

image

and there is another problem

image

It did not install the extension....

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

Are you sure you are looking in the right place? docs/environment.yml specifies sphinxcontrib-video in the pip section, so it isn't installed from conda-forge. You seem to be looking at what is installed from conda-forge though.

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

Anyway, even without the pinning the RTD build will already have the newer version and work once the links are changed from _static/ to videos/. The issue was that locally we had older versions because they came from requirements.d/development.txt, which will install sphinxcontrib-video from conda-forge when following the development setup instructions.

@ReimarBauer
Copy link
Member Author

ReimarBauer commented Aug 14, 2024

It is not there

https://app.readthedocs.org/api/v2/build/25310263.txt

and not working
https://mss.readthedocs.io/en/i2454/tutorial.html

That is likly the main cause + some other change

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

It is not there

https://app.readthedocs.org/api/v2/build/25310263.txt

It should be installed in the Installing pip dependencies: ...working... done step, but there is no more output from pip to say for certain. The entire build should crash though, if it really wasn't there.

and not working
https://mss.readthedocs.io/en/i2454/tutorial.html

Because you haven't changed the links from _static/ to videos/ yet.

@ReimarBauer
Copy link
Member Author

It is not there
https://app.readthedocs.org/api/v2/build/25310263.txt

It should be installed in the Installing pip dependencies: ...working... done step, but there is no more output from pip to say for certain. The entire build should crash though, if it really wasn't there.

and not working
https://mss.readthedocs.io/en/i2454/tutorial.html

Because you haven't changed the links from _static/ to videos/ yet.

Ok, I cannot say it is not installed there, because it does not list any pypi package,

locally it is installed, I do use the same command as it does

mamba env create --quiet --name i2454 --file docs/environment.yml
The docs locally have videos and an url is for example file:///home/reimar/MAIN/MSS/docs/_build/html/_images/tutorial_kml.mp4

I haven't changed _static/ to videos/ yet.
Locally this works but not on RTFD. Now lets see what happens when I change to video.

I assume the result is it works on RTFD and not on local.

@matrss
Copy link
Collaborator

matrss commented Aug 14, 2024

I assume the result is it works on RTFD and not on local.

If you still have the old version locally then yes. With the new version it should work locally as well.

@ReimarBauer
Copy link
Member Author

I assume the result is it works on RTFD and not on local.

If you still have the old version locally then yes. With the new version it should work locally as well.

yes, it does :=)

Thx. I currently try to understand the width difference.

@ReimarBauer
Copy link
Member Author

width is identical to local docs dependent on own screen width.
https://mss.readthedocs.io/en/i2454/tutorials/tutorial_performance_settings.html

@ReimarBauer
Copy link
Member Author

#2460 is a follow up.

@matrss matrss changed the title reconfigured tutorial videos for RTFD and a local build Reconfigured tutorial videos for RTFD Aug 15, 2024
@matrss matrss merged commit d88bf92 into stable Aug 15, 2024
11 checks passed
joernu76 pushed a commit that referenced this pull request Aug 28, 2024
* removing pinned xmlschema (#2117)

* Stop ignoring some test files (#2291)

* Reconfigured tutorial videos for RTFD (#2458)

* changed to videos/

* use mss style on rtfd

* fix urls and text (#2460)

* Bump benc-uk/workflow-dispatch from 1.2.3 to 1.2.4 (#2450)

Bumps [benc-uk/workflow-dispatch](https://github.com/benc-uk/workflow-dispatch) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/benc-uk/workflow-dispatch/releases)
- [Commits](benc-uk/workflow-dispatch@v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: benc-uk/workflow-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Limit video width to the containing block's width (#2463)

* pinning of libtiff is not needed but blocks a more recent libxml2 and others (#2469)

* fixed the model.Message description and tests now using op_id (#2470)

* bug fix for incomplete xml imports (#2468)

validate xml content

* prepare v9.2.0 (#2481)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Matthias Riße <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants