Search code examples
python-sphinxread-the-docs

How to force a file (mp4) to transfer from github to readthedocs


I have a repository on github:

https://github.com/springer-math/Mathematics-of-Epidemics-on-Networks

Within it there is a file

docs/SIR_2dgrid.mp4

which contains an animation I want to appear in the documentation at readthedocs (specifically at this page: http://epidemicsonnetworks.readthedocs.io/en/latest/Simulation_Investigation.html) Additionally, there is a file

docs/Simulation_Investigation.rst

which codes that page and tries to refer to that mp4. I've tried lots of variants (attempting to replication instructions at https://groups.google.com/d/msg/sphinx-users/_z00m3zoRAY/Ryx4D5sxgtcJ), but no luck. The only way I can get the mp4 to appear on the desired readthedocs page is to link to the mp4 on github (but it's got a bit of a delay loading, and isn't perfect).

I cannot seem to get readthedocs to copy over the mp4 into a directory where I can make a relative link to it.

Is there a way to get readthedocs to copy over that file to a place I can link to?

Alternatively, is there another way to embed video in readthedocs short of putting that mp4 up on another website?


Solution

  • Place static files (your .mp4) in a subdirectory named _static.

    Then in your conf.py, set the value of html_static_path to that subdirectory.

    html_static_path = '_static'
    

    The static assets will be copied when the docs are built.