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

左心房为你撑大大i 提交于 2019-12-24 10:23:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/48820321/how-to-force-a-file-mp4-to-transfer-from-github-to-readthedocs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!