Sphinx link 到静态文件

Sphinx link to static file

我在 source/chapter1/section1/intro.rst:

中有这样的 RST 文档
Test Static Path:
=================

{{ pathto('_static/_resources/intro-01_v3.mp4') }}


What I Need:
============

.. raw:: html

   <video width="100%" height="540" controls>
      <source src="{{ pathto('_static/_resources/intro-01_v3.mp4') }}" type="video/mp4">
      Your browser does not support the video tag.
   </video>

但是这个块的 sphinx make html 命令的输出没有 运行 pathto function 视频源 测试部分将是{{ pathto('_static/_resources/intro-01_v3.mp4') }}本身。

我想在浏览器中显示视频,所以无法使用:download: or .. image::

有没有办法将 link/path 获取到 _static 目录中的文件?

我需要一些东西来 GENERATE ../../_static/_resources/intro-01_v3.mp4.

mzjn in comments, by configuring sphinx-jinja 所述并使用 .. jinja:: 指令,它将呈现 pathto.